Welcome! Log In Create A New Profile

Advanced

Re: nginx 0.8.47 php-fpm error_page not working

August 08, 2010 02:54AM
On Sun, Aug 08, 2010 at 02:36:57AM -0400, nginx_newbie wrote:

> Dear Nginx Experts / Friends,
>
> I am new to nginx. Just getting my feet wet since around 15 days.
> I am sorry for this extremely long post. Just wanted to give all
> details
> for quick understanding of the problem hence long code attachments.
>
> I have installed CentOS 5.5 + nginx + php-fpm on linode.com VPS.
> Default error_page 404 in nginx.conf for server localhost is working.
>
> But for domain name based configuration [1] error_page is not working.
> I disabled php-fpm to see if that is the problem, but still I do not see
> the error404.htm
> page. I am also attaching my nginx.conf [2], fastcgi_params [3] &
> php-fpm.conf [4] for reference.
> I even did a debug [5] but could not find any problem from the same.
>
> Attachment One [/etc/nginx/sites-enabled/mutually4u.com]
> ---------------------------------------------------------------------------------------------------------------------------------
> server {
> listen 80;
> server_name www.mutually4u.com mutually4u.com;
> access_log /srv/www/mutually4u.com/logs/access.log;
> error_log /srv/www/mutually4u.com/logs/error.log debug;
>
> error_page 404 /error404.htm;
>
> location /error404.htm {
> root /srv/www/mutually4u.com/public_html;
> }
>
> location = /favicon.ico {
> #empty_gif;
> return 204;
> }
>
> location / {
> root /srv/www/mutually4u.com/public_html;
> index index.htm;

This directive:

> if (-f $request_filename) {
> break;
> }

is useless.

> }
>
> location ~ \.htm$
> {
> root /srv/www/mutually4u.com/public_html;
> fastcgi_pass 127.0.0.1:9000;
> fastcgi_param SCRIPT_FILENAME
> /srv/www/mutually4u.com/public_html$fastcgi_script_name;
> fastcgi_param PATH_INFO $fastcgi_script_name;

You need to add here
fastcgi_intercapt_errors on;

> include /etc/nginx/fastcgi_params;
> }
>
> }

[ ... ]

> I tried all combinations of error_page in / out of the location setting
> before and after the
> fast_cgi options etc.. Even disabling gzip and fastcgi settings but even
> with a plain nginx
> and separate mutually4u.com server config file, i am not able to see the
> redirect error404.htm
> page on the browser. Directly accessing the error404.htm page works
> fine. I am using the
> server version nginx/0.8.47 as seen in the debug output along with php
> 5.2.14 with APC and
> memcache enabled. Even after spending more than 8 hours with various
> options I am clueless.
> I also googled a lot of code to find the cause of this problem and also
> searched this forum,
> but could not find the cause of this simple problem.


--
Igor Sysoev
http://sysoev.ru/en/

_______________________________________________
nginx mailing list
nginx@nginx.org
http://nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx 0.8.47 php-fpm error_page not working

nginx_newbie August 08, 2010 02:36AM

Re: nginx 0.8.47 php-fpm error_page not working

edogawaconan August 08, 2010 02:48AM

Re: nginx 0.8.47 php-fpm error_page not working

nginx_newbie August 09, 2010 12:35AM

Re: nginx 0.8.47 php-fpm error_page not working

Igor Sysoev August 09, 2010 05:22AM

Re: nginx 0.8.47 php-fpm error_page not working

Igor Sysoev August 08, 2010 02:54AM

Re: nginx 0.8.47 php-fpm error_page not working

nginx_newbie August 09, 2010 09:11AM

Re: nginx 0.8.47 php-fpm error_page not working

edogawaconan August 09, 2010 09:34AM

Re: nginx 0.8.47 php-fpm error_page not working

Igor Sysoev August 09, 2010 09:42AM

Re: nginx 0.8.47 php-fpm error_page not working - SOLVED

nginx_newbie August 09, 2010 12:27PM



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