Configuring reverse proxy by Nginx

Feedback


Start Nginx

  1. Unzip nginx to the specified directory
  2. In the root directory of nginx, start nginx by the following command:

start nginx

Exit nginx:

nginx –s quit

  1. check whether to start nginx normally with two ways:

Configure Nginx

Open nginx installation directory\conf\nginx.conf file, modify the server node under http node:

server {

        listen      192.168.120.42:8000;

        server_name   www.myiserver.com;  

        location / iserver{

        proxy_pass   http://192.168.112.217:8090/iserver;

        #proxy_set_header Host $host:8000;

        proxy_set_header ProxyHost $host:8000; }

}

Save above settings, restart nginx to enable it. Restart command:

nginx -s reload

If needed to configure multiple iServer reverse proxies, you can configure multiple server nodes in nginx.conf file.

Access service

http://192.168.120.42:8000/iserver

You also can map 192.168.120.42 for the domain name, just add the followings in C:\Windows\System32\drivers\etc\hosts:

192.168.120.42             www.myiserver.com

Then you can use this address: http://www.myiserver.com:8000/iserver.