fastcgi_hide_header inside an IF statement

Kaspars Dambis kaspars at
Fri Sep 18 19:42:39 MSD 2009

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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the nginx mailing list