title: Nginx: proxy_pass cannot have URI part in location inside "if" statement
body: <p>Suppose there's a nginx configuration:</p>
  
  <pre><code>server {
      ...
      location /nakayoshi {
          if ($georedirect) {
              proxy_pass http://foo.bar/fa/fb/fc;
          }
          proxy_pass http://foo.bar/fa/fb/fd;
      }
  }
  </code></pre>
  
  <p>When I <code>sudo nginx -t</code>, it prints out:</p>
  
  <pre><code>nginx: [emerg] "proxy_pass" cannot have URI part in location given by regular express, or inside named location, or inside "if" statement, or inside "limit_except" block in /etc/nginx/conf.d/nakayoshi.conf
  </code></pre>
  
  <p>Also I've found <code>rewrite</code> help me here, but the redirected uri will change to urls like "<a href="http://foo.bar/fa/fb/fc" rel="nofollow">http://foo.bar/fa/fb/fc</a>".</p>
  
  <p>Can I keep the redirected uris unchanged with <code>proxy_pass</code>?</p>