Welcome! Log In Create A New Profile

Advanced

Setting header for fastcgi response

howard chen
November 24, 2012 01:00AM
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?
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Setting header for fastcgi response

howard chen November 24, 2012 01:00AM

Re: Setting header for fastcgi response

Francis Daly November 24, 2012 05:50AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

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