Welcome! Log In Create A New Profile

Advanced

Re: Weird behavior when checking the existence of a cookie

September 26, 2014 01:14PM
By default the $uri is appended to the proxy_pass directive.
Since you defined as
proxy_pass http://upstream*/*;
and the $uri starts with a slash you will have a double slash.

Try to set proxy_pass like
proxy_pass http://upstream;

On Fri, Sep 26, 2014 at 2:02 PM, Marcello Rocha <marcello.rocha@vagas.com.br
> wrote:

> Hi list, this is my first post here, so If I commit any blunder please let
> me know.
>
> I have this location block:
>
> location /some_path/ {
> # this sets the mobile_rewrite variable based on a regex against
> the user_agent
> include /etc/nginx/mobile;
>
> # This is where the trouble lies. =/
> if ($cookie_mobileBypassDaily = yes_please) {
> set $mobile_rewrite do_not_perform;
> }
>
> if ($mobile_rewrite = perform) {
> return 302 $scheme://
> my.site.com/some_path/fallback_mobile.html;
> break;
> }
> # upstream/ to remove the /some_path/ part of the uri
> proxy_pass http://upstream/;
> }
>
>
> And now to the trouble at hand: if there is no cookie the proxy_pass is
> executed rightly (ie. http://my.server.com/some_path/thing =>
> http://upstream/thing). 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.
> http://my.server.com/some_path/thing => http://upstream//some_path/thing).
>
> Why is this happening? What I'm doing wrong besides, maybe, everything? =)
>
> Thanks for the help
>
> *Marcello Rocha*
> Pesquisa & Desenvolvimento
>
> (11) 4084.1111 ou (xx) 4007.1547 [image: VAGAS] http://bit.ly/1jbOuhG
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Weird behavior when checking the existence of a cookie

Marcello Rocha September 26, 2014 01:04PM

Re: Weird behavior when checking the existence of a cookie

wandenberg September 26, 2014 01:14PM

Re: Weird behavior when checking the existence of a cookie

Marcello Rocha September 30, 2014 04:28PM

Re: Weird behavior when checking the existence of a cookie

Francis Daly September 30, 2014 06:26PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 312
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready