NGINX with Tomcat configuration NGINX with Tomcat configuration nginx nginx

NGINX with Tomcat configuration


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