error_page + FastCGI

Maxim Dounin mdounin на mdounin.ru
Пн Авг 15 06:49:59 UTC 2011


Hello!

On Mon, Aug 15, 2011 at 10:27:48AM +0400, Valentin Vesvalo wrote:

> ????????????.
> 
> ?? ??????? ??????????? ? ?????????? ????????? error_page.
> 
> ??????? nginx (0.8.55), ???????????? ??????? ?? php-fpm.
> ????????? ???????? ???????? ???? ? ?????? ?????? 50x ??? ??????????
> php-????????.
> 
> ???????? ? ???, ??? ????????? error_page ????????????, ???? php-fpm
> ?????? ????? ??? ?????????? ???????, ???????????????? header ?? ????????
> 500:
> <?php
> header('Status: 500',true,500);
> 
> ??????? header('HTTP/1.1 500 Internal Server Error',true,500) ??? ?? ??
> ???????? ? ????????? ??????????.
> 
> ???? ?? php-fpm ?????? ?????????, ?? error_page ???????????? ??? ?????.
> 
> ? ??? ????? ???? ???????
> 
> ? ??????? ????????? ????????? ???????:
> 
> location = /500.html {
>   root   html;
> }
> 
> location ~ \.php$ {
>  fastcgi_pass   localhst;
>  fastcgi_index  index.php;
>  include        fastcgi_params;
>  fastcgi_param  SCRIPT_FILENAME  /wwwroot/test/public$fastcgi_script_name;
>  error_page 500 501 502 503 = /500.html;
> }

http://sysoev.ru/nginx/docs/http/ngx_http_fastcgi_module.html#fastcgi_intercept_errors

Maxim Dounin

p.s. Please fix charset in your messages, this one is unreadable 
except in html part.  And please fix your mail client not to send 
html.  Thank you.



Подробная информация о списке рассылки nginx-ru