<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">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/">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">http://my.server.com/some_path/thing</a> => <a href="http://upstream/thing">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">http://my.server.com/some_path/thing</a> => <a href="http://upstream//some_path/thing">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>