Loading... 1.检测配置是否正确 nginx -t 2.重载配置,使其立即生效 nginx -s reload 3.代理Tomcat服务 修改Nginx.cnf文件 location / { proxy_pass http://backend; #来自jsp请求交给tomcat处理 proxy_redirect off; proxy_set_header Host $host; #后端的Web服务器可以通过X-Forwarded-For>获取用户真实IP proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } updtream backend{ server 192.168.0.100 weight=1; server 192.168.0.101 weight=5; } Last modification:August 12, 2019 © Allow specification reprint Support Appreciate the author AliPayWeChat Like 0 如果觉得我的文章对你有用,请随意赞赏