error_page return code
Maxim Dounin
mdounin at mdounin.ru
Mon Jul 7 16:33:05 MSD 2008
Hello!
On Mon, Jul 07, 2008 at 12:46:54PM +0300, Andrew Sitnikov wrote:
>Hello nginx-ru,
>
> Есть такой конфиг
>
> error_page 501 =200 /errors/501.html;
> error_page 502 =200 /errors/502.html;
> error_page 503 =200 /errors/503.html;
> error_page 504 =200 /errors/504.html;
> error_page 505 =200 /errors/505.html;
>
> location /foo_504 {
> return 504;
> }
> location /errors {
> root $static_root/pics;
>
> expires -1;
>
> if (!-f $request_filename) {
> rewrite . /errors/50x.html break;
> }
> }
>
>
> запрашиваем c backend долгий скрипт - GET /sleep_long.php HTTP/1.0 страница выдается нормально, но с кодом 504
>
>2008/07/07 12:46:32 [debug] 20014#0: *27417 free rr peer failed: 1 0
>2008/07/07 12:46:32 [error] 20014#0: *27417 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 212.7.1.2, server: www.*****.**, request: "GET /sleep_long.php HTTP/1.1", upstream: "http://10.8.2.20:80/sleep_long.php", host: "www.*****.**"
>2008/07/07 12:46:32 [debug] 20014#0: *27417 finalize http upstream request: 504
>2008/07/07 12:46:32 [debug] 20014#0: *27417 finalize http proxy request
>2008/07/07 12:46:32 [debug] 20014#0: *27417 free rr peer 0 0
>2008/07/07 12:46:32 [debug] 20014#0: *27417 close http upstream connection: 143
>2008/07/07 12:46:32 [debug] 20014#0: *27417 http finalize request: 504, "/sleep_long.php?"
>2008/07/07 12:46:32 [debug] 20014#0: *27417 http special response: 504, "/sleep_long.php"
>2008/07/07 12:46:32 [debug] 20014#0: *27417 http set discard body
>2008/07/07 12:46:32 [debug] 20014#0: *27417 internal redirect: "/errors/50x.html?"
Ушло в /errors/50x.html сразу. Т.е. судя по всему конфиг не
соответствует тому что приведено выше. Видимо error_page
определён ещё и в location'е с proxy_pass'ом.
Maxim Dounin
More information about the nginx-ru
mailing list