#负载均衡配置
upstream testDomain {
server 127.0.0.1:8080 weight=1;
server 127.0.0.1:8081 weight=3;
}
server {
listen 80;
server_name test123.com;
#匹配的请求路径
location / {
root html;
index index.html index.htm;
#代理指向
proxy_pass http://testDomain;
}
}
常用命令
启动
直接点击Nginx目录下的nginx.exe 或者 cmd运行start nginx
nginx -s stop | fast shutdown |
nginx -s quit | graceful shutdown |
nginx -s reload | changing configuration,starting new worker processes with a new configuration,graceful shutdown of old worker processes |
nginx -s reopen | re-opening log files |