Welcome! Log In Create A New Profile

Advanced

Re: try_files... don't think I'm doing it right.

March 20, 2009 05:39AM
<49C3530F.7000102@theactivitypeople.co.uk> <20090320085035.GG72589@rambler-co.ru> <49C35C83.7090704@theactivitypeople.co.uk>

On Fri, Mar 20, 2009 at 09:06:11AM +0000, Phillip B Oldham wrote:

> Igor Sysoev wrote:
> >The try_files test files existance and fallback to last parameter.
> >As there is no @zine file it always goes to @fallback.
> >You config should be
> >
> >server {
> > listen 80;
> > server_name mysite.com;
> >
> > error_page 500 502 503 504 /maintenance.html;
> >
> > location / {
> > include conf/fastcgi_params;
> > fastcgi_param PATH_INFO $fastcgi_script_name;
> > fastcgi_param SCRIPT_NAME "";
> > fastcgi_pass unix:/tmp/mysite.socket;
> >
> > fastcgi_intercept_errors on;
> > }
> >
> > location = /maintenance.html {
> > root /var/www/mysite;
> > }
> >}
> >
> Ah ha! Didn't spot the fastcgi_intercept_errors in the config docs when
> I first tried a similar config. Is there a reason why its not "on" by
> default?

I mistaked, in case of 502 and 504 errors, you do not need
fastcgi_intercept_errors as these errors come from nginx: it could not
connect(), timeout, etc. However, if your backend returns 502/504
then fastcgi_intercept_errors is required.

fastcgi_intercept_errors is off by default, because it does not affect
on nginx's 502/504 and you may want to show your own backend pages for
500/404/etc.


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

try_files... don't think I'm doing it right.

Phillip B Oldham March 20, 2009 04:53AM

Re: try_files... don't think I'm doing it right.

Igor Sysoev March 20, 2009 05:16AM

Re: try_files... don't think I'm doing it right.

Phillip B Oldham March 20, 2009 05:30AM

Re: try_files... don't think I'm doing it right.

Igor Sysoev March 20, 2009 05:39AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 61
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready