#user nobody;
Worker_processes 1;
#error_log Logs/error.log;
#error_log Logs/error.log Notice;
#error_log Logs/error.log Info;
#pid Logs/nginx.pid;
Events {
Worker_connections 1024;
}
HTTP {
Include Mime.types;
Default_type Application/octet-stream;
Sendfile on;
Keepalive_timeout 65;
Upstream driver-interface{
server ip1:8081 max_fails=0;
#server ip2:8082 max_fails=0;
}
Upstream driver-admin{
#server 218.66.19.173:8081 max_fails=0;
Server 192.168.3.21:8082 max_fails=0;
}
server {
Listen 80;
server_name localhost;
location/drive/mobile/{//Here Control Interface (MOBILE) proxy jump
root HTML;
Proxy_redirect off;
Proxy_set_header Host $host: 80;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Index index.html index.htm;
Proxy_pass Http://driver-interface;
proxy_redirect default;
}
Location ~ */(Admin|js|css|img|images) {//Here control Management background (admin) proxy jump, because background has style, JS and picture, prefix does not include admin. So it needs to be configured here
root HTML;
Index index.html index.htm;
is to re-forward the requested domain name to the page (paging, or directly get the request domain name needs, if not configured to read to Http://driver-interface)
Proxy_redirect off;
Proxy_set_header Host $host: 80;
Proxy_set_header X-real-ip $remote _addr;
Proxy_set_header x-forwarded-for $proxy _add_x_forwarded_for;
Proxy_pass http://driver-admin;
proxy_redirect default;
}
Location/{
root HTML;
Index index.html index.htm;
}
Error_page 502 503 504/50x.html;
Location =/50x.html {
root HTML;
}
}
}
Windows Nginx Configures response agent (same NG Port) based on request address