<div dir="ltr">By default the $uri is appended to the proxy_pass directive.<div>Since you defined as <br>proxy_pass <a href="http://upstream">http://upstream</a><b>/</b>;<br>and the $uri starts with a slash you will have a double slash.</div><div><br></div><div>Try to set proxy_pass like <br>proxy_pass <a href="http://upstream">http://upstream</a>;</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 26, 2014 at 2:02 PM, Marcello Rocha <span dir="ltr"><<a href="mailto:marcello.rocha@vagas.com.br" target="_blank">marcello.rocha@vagas.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div>Hi list, this is my first post here, so If I commit any blunder please let me know.<br><br></div>I have this location block:<br><br><span style="font-family:courier new,monospace">location /some_path/ {<br></span></div><span style="font-family:courier new,monospace"> # this sets the mobile_rewrite variable based on a regex against the user_agent <br></span><div><span style="font-family:courier new,monospace"> include /etc/nginx/mobile;<br> <br></span></div><div><span style="font-family:courier new,monospace"> # This is where the trouble lies. =/<br></span></div><div><span style="font-family:courier new,monospace"> if ($cookie_mobileBypassDaily = yes_please) {<br> set $mobile_rewrite do_not_perform;<br> }<br><br> if ($mobile_rewrite = perform) {<br> return 302 $scheme://<a href="http://my.site.com/some_path/fallback_mobile.html" target="_blank">my.site.com/some_path/fallback_mobile.html</a>;<br> break;<br> }</span><span style="font-family:courier new,monospace"><br></span></div><div><span style="font-family:courier new,monospace"> # upstream/ to remove the /some_path/ part of the uri<br></span></div><div><span style="font-family:courier new,monospace"> proxy_pass <a href="http://upstream/" target="_blank">http://upstream/</a>;<br> }</span><br><div><br><br></div><div>And now to the trouble at hand: if there is no cookie the proxy_pass is executed rightly (ie. <a href="http://my.server.com/some_path/thing" target="_blank">http://my.server.com/some_path/thing</a> => <a href="http://upstream/thing" target="_blank">http://upstream/thing</a>). If the cookie exists the proxy_pass not only has the some_path part of the url but it also has an extraneous slash (ie. <a href="http://my.server.com/some_path/thing" target="_blank">http://my.server.com/some_path/thing</a> => <a href="http://upstream//some_path/thing" target="_blank">http://upstream//some_path/thing</a>).<br><br></div><div>Why is this happening? What I'm doing wrong besides, maybe, everything? =) <br><br></div><div>Thanks for the help<br></div><div><br clear="all"></div><div><div><div><div dir="ltr"><font style="font-family:verdana,sans-serif;color:rgb(119,139,151);font-size:12px;line-height:18px">
<b style="font-size:15px;margin:0px;color:rgb(0,118,189);line-height:14pt">Marcello Rocha</b><br>
<span style="font-size:14px">Pesquisa & D</span>esenvolvimento<br>
<br>(11) 4084.1111 ou (xx) 4007.1547</font>
<img src="http://site.vagas.com.br/img/assinatura-2014/linha.gif" alt="" style="display:block" height="37" width="390">
<a href="http://bit.ly/1jbOuhG" target="_blank"><img src="http://site.vagas.com.br/img/assinatura-2014/logo-vagas.gif" alt="VAGAS" height="29" width="111"></a>
</div></div>
</div></div></div></div>
<br>_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br></blockquote></div><br></div>