Re: ïÂÒÁÂÏÔËÁ ÏÛÉÂÏË × ÏÔÄÅÌØÎÏÍ backendÅ.

igor.goncharenko nginx-forum ÎÁ nginx.us
óÒ ñÎ× 20 14:14:50 MSK 2010


ïÐÒÅÄÅÌÑÀ ÐÅÒÅÍÅÎÎÕÀ ËÁË error_status:
set $error_status $upstream_status;

É ×Ù×ÏÖÕ ÅÅ ÞÅÒÅÚ format_log:
"error_status: $error_status"

×ÓÅ ÞÅÓÔÎÏ, ÏÄÎÏ ÚÎÁÞÅÎÉÅ:
192.168.1.200 - - [20/Jan/2010:11:02:34 +0000] "GET / HTTP/1.1" 502  169 "-" "Mozilla/5.0 (X11; U; FreeBSD i386; ru; rv:1.9.1.7) Gecko/20100108 Firefox/3.5.7" "-" "gzip:-" "error_status: 502"

÷ ÂÜËÅÎÄÅ ÐÒÏ×ÅÒËÁ ÓÅÊÞÁÓ ÓÔÏÉÔ É ÎÁ 500 É ÎÁ 502 ÏÛÉÂËÕ:
if ($http_X-Previous-Error = 500) { return 500; }
if ($http_X-Previous-Error = 502) { return 500; }

Posted at Nginx Forum: http://forum.nginx.org/read.php?21,43006,43372#msg-43372




ðÏÄÒÏÂÎÁÑ ÉÎÆÏÒÍÁÃÉÑ Ï ÓÐÉÓËÅ ÒÁÓÓÙÌËÉ nginx-ru