NGINX with Tomcat configuration

谁说胖子不能爱 提交于 2019-12-03 03:19:05
Jason

You can using proxy_pass mapping to your tomcat server port, for example : if your tomcat port is 8080, your conf/nginx.conf should be configured like this:

...
http {
    ...

    server {
        location / {
            proxy_pass http://127.0.0.1:8080;
            proxy_set_header X-Real-IP $remote_addr;
        }
    }
}

restart it sbin/nginx -s reload, then when you can access http://127.0.0.1, the request forward to tomcat.

Configuration file is placed commonly under:

/etc/nginx/nginx.conf
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!