一.nginx Windows版本号:nginx-1.12.2
二.下载地址
https://download.csdn.net/download/cyw8998/26358326
或者http://nginx.org/download/nginx-1.12.2.zip
三.nginx基础命令:
解压后,启动nginx.exe 或者命令行启动 ./nginx
重启命令 nginx -s reload
快速关闭 nginx -s stop
有序关闭 nginx -s quit
四.负载均衡测试:
1.搭建两个web服务,同一机器端口号不同就行
2.修改nginx/conf/nginx.conf文件
upstream springboot.web.server{
server localhost:18001; #服务1
server localhost:18002; #服务2
}
server {
listen 18000;
server_name localhost;
location / {
proxy_pass http://springboot.web.server;
proxy_redirect default;
root html;
index index.html index.htm;
}
........
}
之后访问http://localhost:18000 就可以看到随机跳转到18001或者18002



