Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_ignore_headers inside if{} - block

Maxim Dounin
March 10, 2015 10:24AM
Hello!

On Sun, Mar 08, 2015 at 12:10:04PM +0200, wishmaster wrote:

> Hi.
>
> I need set some fascgi_* inside "if" block. E.g.:
>
> if ($foo = "bar") {
> fastcgi_ignore_headers "Set-Cookie";
> }
>
> But the error is occure on configtest stage:
>
> nginx: [emerg] "fastcgi_ignore_headers" directive is not allowed here
>
> Is there any workaround?

See these article for general hints:

http://wiki.nginx.org/IfIsEvil
http://wiki.nginx.org/IfIsEvil#What_to_do_instead

In this particular case, it should also be possible to use
fastcgi_ignore_headers unconditionally, with appropriate
fastcgi_no_cache additionally configured (see
http://nginx.org/r/fastcgi_no_cache for details).

--
Maxim Dounin
http://nginx.org/

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

fastcgi_ignore_headers inside if{} - block

artem March 08, 2015 06:12AM

Re: fastcgi_ignore_headers inside if{} - block

Maxim Dounin March 10, 2015 10:24AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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