Welcome! Log In Create A New Profile

Advanced

Re: fastcgi_hide_header inside an IF statement

September 18, 2009 12:08PM
On Fri, Sep 18, 2009 at 06:42:39PM +0300, Kaspars Dambis wrote:

> I have two php scripts (css.php and js.php) which combine all css and js
> files. To make things faster on the client side, I want to
>
> - set expires header to far future
> - not set cookies for those request
>
> Here is what works now:
> location ~ \.php$ {
> # php cgi stuff goes here
>
> if ($request_uri ~ (css|js)\.php) {
> expires max;
> }
> }
>
> location ~ (css|js)\.php {
> fastcgi_hide_header Set-Cookie;
> }
>
> The question is -- why it's not allowed to use *fastcgi_hide_header
> Set-Cookie;* inside the if () { ... } statement?

Because "if" is ugly hack. Period.

You should use

location = /css.php {
# php stuff
fastcgi_hide_header Set-Cookie;
expires max;
}

location = /js.php {
# php stuff
fastcgi_hide_header Set-Cookie;
expires max;
}


--
Igor Sysoev
http://sysoev.ru/en/
Subject Author Posted

fastcgi_hide_header inside an IF statement

Kaspars Dambis September 18, 2009 11:46AM

Re: fastcgi_hide_header inside an IF statement

Igor Sysoev September 18, 2009 12:08PM

Re: fastcgi_hide_header inside an IF statement

Kaspars Dambis September 18, 2009 02:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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