java - NGINX with Tomcat configuration -


I'm new to Nginx and I need your help,

According to several forums It was understood that all our static pages are stored in Nginx when the request is made, then I have to go through that request to get the badge for the data and to respond to the Tomcat response.

At present, I have done just that I request straightforwardly, and answer the request. But I think this is not a solution for performance.

So can someone help me?

You can use proxy_pip mapping on your tomeck server port, for example: if your tomat If port is 8080, then your conf / nginx.conf should be configured in such a way:

  ... http {... server {location / {proxy_pass http://127.0.0.1: 8080; Proxy_set_header X-real-IP $ remote_adder; }}}   

Restart sbin / nginx -s reload, then when you can use http://127.0.0.1 Then the request will proceed.

The configuration file is usually placed below:

  /etc/nginx/nginx.conf    

Comments