nginx安装、基本操作

(妈的,我安装了两天,现在才发现,没有指定安装地址啊啊啊啊)

我现在nginx文件路径:/home/quxiao/dockerfile2/nginx-1.18.0(经过我的实践,这个地方的配置文件毫无卵用,启动路径的才是真正的!!!)

启动路径:/usr/local/nginx:

1解压:tar -zxvf nginx-1.24.0.tar.gz

2安装:./configure --prefix=/usr/local/nginx

              make && make install

可以直接把安装好的包放在 usr/local/下面:

链接:https://pan.baidu.com/s/1hUgUruubsXGX17ozBKTuvg 
提取码:ydhl


#user  nobody;
worker_processes  1;

#error_log  logs/error.log;
#error_log  logs/error.log  notice;
#error_log  logs/error.log  info;

#pid        logs/nginx.pid;


events {
    worker_connections  1024;
}


http {
    include       mime.types;
    default_type  application/octet-stream;

    #log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
    #                  '$status $body_bytes_sent "$http_referer" '
    #                  '"$http_user_agent" "$http_x_forwarded_for"';

    #access_log  logs/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    #keepalive_timeout  0;
    keepalive_timeout  65;

    #gzip  on;
	#负载均衡的地址
	upstream qx {
	
    server 127.0.0.1:8080 weight=1;
    server 127.0.0.1:8081 weight=1;
	
    }

    server {
        listen       80;
        server_name  localhost;
		#代理
        location / {
            root   html;
            index  index.html index.htm;
			proxy_pass http://qx;
        }

    
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }
}

你可能感兴趣的:(docker,容器,运维)