Nginx 开启反向代理本地tomcat

nginx配置
http://www.cnblogs.com/taosim/articles/3107626.html

nginx安装
http://alwaysyunwei.blog.51cto.com/3224143/1230275

需要设置nginx.conf
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
        #
        location ~ {
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass   http://127.0.0.1:8080;
        }

同时修改tomcat中的server.xml中
Connector address="127.0.0.1"
关闭外网对8080端口的访问

猜你喜欢

转载自jis117.iteye.com/blog/2272247
今日推荐