title: Nginx cannot forward request
body: <p>I have a local server. I want to forward requests to it through an nginx server.</p>
  <p>The local url is: <code>http://192.168.0.1/icon.jpg</code>. I tried some of settings but I dont know why just option 1 is working</p>
  <p><strong>Option 1:</strong></p>
  <pre><code>location ~ &quot;/fw/(?&lt;img&gt;[a-z]+)$&quot; {
      proxy_pass http://192.168.0.1/$img.jpg;
      proxy_http_version 1.1;
  }
  </code></pre>
  <p>=&gt; The url now: http://domain/fw/icon</p>
  <p><strong>Option 2:</strong></p>
  <pre><code>location ~ &quot;/fw/(?&lt;img&gt;[a-z]+)\.jpg$&quot; {
      proxy_pass http://192.168.0.1/$img.jpg;
      proxy_http_version 1.1;
  }
  </code></pre>
  <p>=&gt; The url now: http://domain/fw/icon.jpg</p>
  <p><strong>Option 3:</strong></p>
  <pre><code>location ~ &quot;/fw/(?&lt;img&gt;.+)$&quot; {
      proxy_pass http://192.168.0.1/$img;
      proxy_http_version 1.1;
  }
  </code></pre>
  <p>=&gt; The url now: http://domain/fw/icon.jpg</p>