title: NGINX rewrite always returns 302
body: <p>I am completely stumped by the behavior of nginx rewrite. I have the following 2 location blocks - the first one simply rewrites so that the second one gets called.</p>
  
  <pre><code>location /alt/digest/rewrite {
      rewrite /alt/digest/rewrite http://$server_name/digest/wms break;
  }
  
  location /digest/wms {
     ...
  }
  </code></pre>
  
  <p>But I always get the following back on my curl app, when I hit <a href="http://server_name/alt/digest/rewrite" rel="nofollow">http://server_name/alt/digest/rewrite</a></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;&lt;title&gt;302 Found&lt;/title&gt;&lt;/head&gt;
  &lt;body bgcolor="white"&gt;
  &lt;center&gt;&lt;h1&gt;302 Found&lt;/h1&gt;&lt;/center&gt;
  &lt;hr&gt;&lt;center&gt;nginx/1.6.2&lt;/center&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Any help would be appreciated.</p>