Francis Daly
August 14, 2014 01:18PM
On Thu, Aug 14, 2014 at 10:16:43AM -0400, bodomic wrote:

Hi there,

> Actually, the second problem is described in this document too, I think I
> should re-read it every time I want to use IF.

"if" is fine.

It is only "if inside location" which needs care.

My general guideline is:

do "return ..."; or
do "rewrite ... last"; or
don't do it without understanding it.

> In my example (before posting it here) I've dropped the second IF in the
> same location without much thought.
> That's why it worked for you. That's why it worked in a separate location -
> I didn't move a second IF there, and again, did not pay enough attention to
> that.

Ah, right. Yes, it is always best to create a scratch system with a
small config that reliably shows the problem you encounter (and which
contains no private information), and then copy-paste exactly what is
in the scratch system.

That way, everyone testing things is looking at the same thing.

(And the "nginx -V" output can be useful too, in case there are version
or compile-time differences which matter.)

> So, the problem was the second IF in the same location.

I'd say that the problem was using "if" inside "location" without
understanding the nginx quirks.

Two or three "if"s might have been ok. One might have caused things not
to work as you wanted.

f
--
Francis Daly francis@daoine.org

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

add_header is not working in certain locations

bodomic August 13, 2014 02:28AM

Re: add_header is not working in certain locations

Francis Daly August 13, 2014 07:34PM

Re: add_header is not working in certain locations

bodomic August 14, 2014 08:50AM

Re: add_header is not working in certain locations

itpp2012 August 14, 2014 09:24AM

Re: add_header is not working in certain locations

bodomic August 14, 2014 10:07AM

Re: add_header is not working in certain locations

bodomic August 14, 2014 10:16AM

Re: add_header is not working in certain locations

Francis Daly August 14, 2014 01:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 284
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