Nginx reverse proxy setup tutorial

  
under Linux

Nginx is not only a common web server, but also a high-performance reverse proxy server. Let's talk about the configuration of reverse proxy.

Because the server does not only run php, there are some jsp programs, so you need to use the reverse proxy to specify the corresponding port to the local.

The following is an example of the next jsp website proxy for the server: server { listen 80; server_name portal.jser.io; server_tokens off; # hide nginx version number location /{proxy_pass http://localhost:8080/;proxy_redirect off;proxy_set_header Host $host;proxy_set_header X-Real-IP $remote_addr;proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;}}

If portal.jser.io accesses this server directly from the server Go to port 8080 of Tomcat and implement a reverse proxy.

You can use this method to configure multiple sites for a server and assign them to different directories or ports through different domain names.

Copyright © Windows knowledge All Rights Reserved