Welcome! Log In Create A New Profile

Advanced

Re: nginx 0.8.47 php-fpm error_page not working

August 09, 2010 09:42AM
On Mon, Aug 09, 2010 at 09:11:27AM -0400, nginx_newbie wrote:

> Dear Igor,
>
> Thanks for taking the time to look into my problem!
> Since I wanted error404.htm to be parsed by PHP, I removed the
> error_page line
> and corresponding location block from the configuration file and placed
> a new
> error_page line within the location block that is passing all HTM files
> to PHP
>
> While at present error404.htm is plain html file, it will ultimately by
> a PHP file later.
> On slowly trying to understand the debug output, I see that nginx is
> going all the way
> to evoke parsing error404.htm and also send in the headers to the
> browser. But nothing
> is visible there after. All that I get on the browser (Google Chrome) as
> output is standard
> error from Chrome "Oops! This link appears to be broken.".
>
> Since the problem still remains unsolved, I am attaching the fresh
> server config
> file for your reference along with the debug output after all these
> changes.

PHP has returned 404:

> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi header: "Status:
> 404 Not Found"

nginx has redirected the 404 to "/error404.htm":

> 2010/08/09 18:26:13 [debug] 19232#0: *7 internal redirect:
> "/error404.htm?"

It's passed to PHP:

> 2010/08/09 18:26:13 [debug] 19232#0: *7 fastcgi param: "SCRIPT_FILENAME:
> /srv/www/mutually4u.com/public_html/error404.htm"

PHP has returned 170 bytes including header and page itself:

> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi record length: 170
> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi parser: 0
> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi header:
> "X-Powered-By: PHP/5.2.14"
> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi parser: 0
> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi header:
> "Content-type: text/html"
> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi parser: 1
> 2010/08/09 18:26:13 [debug] 19232#0: *7 http fastcgi header done

nginx returns 404 code with PHP page to client:

> 2010/08/09 18:26:13 [debug] 19232#0: *7 HTTP/1.1 404 Not Found
> Server: nginx/0.8.47
> Date: Mon, 09 Aug 2010 12:56:13 GMT
> Content-Type: text/html
> Transfer-Encoding: chunked
> Connection: keep-alive
> X-Powered-By: PHP/5.2.14
> Content-Encoding: gzip

Chrome recently(?) started to show its own "friendly" error page as MSIE
does if error page is shorter than 512 bytes. nginx appends several
lines:
"<!-- a padding to disable MSIE and Chrome friendly error page -->"
to its internal error pages to increase page size, if the "msie_padding"
directive is on (by default). Try to look in other browser or try to add
some comment lines to your pages.


--
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: 105
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