title: How to exact match a nginx location?
body: <p>I am configuring a nginx revser proxy. The result should be when user type <code>http://10.21.169.13/mini</code>, then the request should be <code>proxy_pass to 192.168.1.56:5000</code>. Here is the <code>nginx</code> config:</p>
  
  <pre><code>server {
          listen 80;
          server_name 10.21.169.13;
  
          location = /mini {
                  proxy_pass http://192.168.1.65:5000;
                  include /etc/nginx/proxy_params;
          }
  }
  </code></pre>
  
  <p>The above <code>location</code> block never worked with <code>http://10.21.169.13/mini</code>. The only <code>location</code> block worked is:</p>
  
  <pre><code>server {
          listen 80;
          server_name 10.21.169.13;
  
          location  / {
                  proxy_pass http://192.168.1.65:5000;
                  include /etc/nginx/proxy_params;
          }
  }
  </code></pre>
  
  <p>But the above config also match <code>http://10.21.169.13</code> request which is too board. </p>
  
  <p>What <code>location</code> block will only match '<a href="http://10.21.169.13/mini" rel="nofollow noreferrer">http://10.21.169.13/mini</a>` and no more?</p>
  
  <p>UPDATE: tried and failed with the following:</p>
  
  <pre><code> location  /mini {
                      proxy_pass http://192.168.1.65:5000;
                      include /etc/nginx/proxy_params;
              }
  
  location  /mini/ {
                      proxy_pass http://192.168.1.65:5000;
                      include /etc/nginx/proxy_params;
              }
  </code></pre>
  
  <p>The error is <code>request not found</code>.</p>