1. Ruqirement
nginx accepts the request url uniformly and forwards it
http://172.16.51.91:9000/api/order/create/44010000
http://172.16.51.91:9000/api/order/create/44060000
目标:
http://172.15.10.13:9001/api/order/create
http://172.15.10.13:9002/api/order/create
2. nginx Settings
nginx accepts the request url uniformly and forwards it
http://172.16.51.91:9000/api/order/create/44010000
http://172.16.51.91:9000/api/order/create/44060000
目标:
http://172.15.10.13:9001/api/order/create
http://172.15.10.13:9002/api/order/create
2. nginx Settings
server {
listen 9000;
server_name 172.16.51.91;
location ~*(44010000)$ {
rewrite ^/(.*)/44010000$ http://172.15.10.13:9001/$1 permanent;
}
location ~*(44060000)$ {
rewrite ^/(.*)/44060000$ http://172.15.10.13:9002/$1 permanent;
}
}
Read More:
- Nginx routes and forwards according to the URL and cuts the URL
- The request was rejected because the URL contained a potentially malicious String “//“
- Nginx Startup Error: “/var/run/nginx/nginx.pid” failed” [How to Solve]
- [Solved] nginx: [error] open() “/usr/local/nginx/nginx.pid” failed (2: No such file or directory)
- Nginx Error: nginx: [emerg] the “ssl“ parameter requires ngx_http_ssl_module in /project/api/nginx.conf:
- Nginx configuration 80 can be accessed by forcing jump 443 or not
- [Solved] Nginx Restart Error: /run/nginx.pid failed (2: No such file or directory)
- Common configuration methods of nginx
- Nginx error: nginx: [error] invalid PID number ““ in “/run/nginx.pid“
- Git Push Error: error: RPC failed; HTTP 413 curl 22 The requested URL returned error: 413
- Nginx Error: Swap file “/etc/nginx/.nginx.conf.swp“ already exists
- Nginx realizes the same background service for portal and business
- Nginx Error: [emerg] bind() to [::]:80 failed (98: Address already in use)
- Nginx Startup Error: Job for nginx.service failed because the control process exited with error code
- How to Fix No default.conf file in conf.d after Installing Nginx
- [Solved] yocto Compile Error: ERROR: libtinyxml2-XXX do_fetch: Fetcher failure for URL
- [Solved] Nginx Startup Error: directive is not allowed here in
- Solve the problem of 404 Not Found error in nginx accessing dynamic interface
- nginx: [emerg] bind() to 0.0.0.0:80 failed (13: Permission denied)
- summary of configuration and deployment of uwsgi+nginx+flag in centos7 and why internal server error is prompted [official instructions]