4.5.1 Nginx反向代理与系统参数配置conf原理

/usr/local/nginx/sbin/nginx -c nginx.conf
/usr/local/nginx/sbin/nginx -s reload
/usr/local/nginx/sbin/nginx -s stop

nginx ->进程 -> server

worker_processes 4;

events {
	worker_connections 1024;
}
http {
	upstream_backend {
		server 192.168.159.130:9002 weight=2;
		server 192.168.159.130:9003 weight=3;
	}

	server {
		listen 8080;
		location / {
			root /home/gyl/html/;
			proxy_pass http://backend;
		}
	}
	server {
		listen 8001;
	}
}

listen在master进程,connection在work进程。

你可能感兴趣的:(零声教育,nginx,运维)