Welcome! Log In Create A New Profile

Advanced

Re: Setting header for fastcgi response

Francis Daly
November 24, 2012 05:50AM
On Sat, Nov 24, 2012 at 01:58:16PM +0800, howard chen wrote:

Hi there,

in nginx, one request is handled in one location.

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

Your request for /foo should be handled in that location. It will,
depending on the configuration that you haven't shown, try to serve the
file /usr/local/nginx/html/foo with a few extra http headers.

> This path does not exist, and it goes into the fcgi using
>
> location / {
> try_files $uri $uri/ /index.php?$args;
> }

The configuration you have shown does not indicate that that will happen.

(Unless, perhaps, you have something like an error_page directive
in place.)

> curl -v 'http://www.example.com/foo'
>
> < HTTP/1.1 404 Not Found
> bar <-- actual output from backend, but why 404?
>
> Any idea?

Can you provide a config file that is enough to demonstrate what you
are reporting?

Thanks,

f
--
Francis Daly francis@daoine.org

_______________________________________________
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