How to exact match a nginx location?

Jun Chen acgtek at yahoo.com
Tue Mar 28 01:43:41 UTC 2017


 
  
|  I am configuring a nginx revser proxy. The result should be when user type http://10.21.169.13/mini, then the request should be proxy_pass to 192.168.1.56:5000. Here is the nginx config:server {
        listen 80;
        server_name 10.21.169.13;

        location = /mini {
                proxy_pass http://192.168.1.65:5000;
                include /etc/nginx/proxy_params;
        }
}
The above location block never worked with http://10.21.169.13/mini. The only location block worked is:server {
        listen 80;
        server_name 10.21.169.13;

        location  / {
                proxy_pass http://192.168.1.65:5000;
                include /etc/nginx/proxy_params;
        }
}
But the above config also match http://10.21.169.13 request which is too board. What kind of location block will only match 'http://10.21.169.13/mini` and no more?  |

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20170328/97a04c67/attachment.html>


More information about the nginx mailing list