Setting header for fastcgi response

howard chen howachen at gmail.com
Sat Nov 24 05:58:16 UTC 2012


Hi,

In my nginx config, I have a virtual path (/foo), e.g.

location = /foo {
  expires 1h;
  add_header Cache-Control "public";
}

This path does not exist, and it goes into the fcgi using

location / {
  try_files $uri $uri/ /index.php?$args;
}

location ~* \.php$ {
  ..
}

The problem is the 1st location block is adding 404 to every response even
I can route the request to the backend.


E.g.

 curl -v  'http://www.example.com/foo'

< HTTP/1.1 404 Not Found
bar <-- actual output from backend, but why 404?

Any idea?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20121124/8f011d36/attachment-0001.html>


More information about the nginx mailing list