Configuring reverse proxy by Nginx |
start nginx
Exit nginx:
nginx –s quit
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; }
}
If the iServer service after nginx proxy is registered in the iPortal, and the service passes through the iPortal proxy, in order to ensure that the iServer service can be accessed normally after two proxies, it is recommended to set the Host parameter and ProxyHost parameter as: Host $http_host and ProxyHost $http_host.
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.
Accessing the service address after reverse (http://192.168.120.42:8000/iserver) proxy can obtain the same content as accessing the original server
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.