Welcome! Log In Create A New Profile

Advanced

503 и add_header Retry-After

xinu
September 29, 2010 10:34AM
добрый день,

хотел приписать к 503 Header: "Retry-After", к сожалениу - add_header работает только с малым числом return:
"... Директива добавляет строку в заголовке ответа при условии, что код ответа равен 200, 204, 301, 302 или 304. ..."

етот малый набор кодов - ето фича?
и почему такая избирательность?
и как сделать правильно ето?:

(http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html)
10.5.4 503 Service Unavailable

The server is currently unable to handle the request due to a temporary overloading or maintenance of the server. The implication is that this is a temporary condition which will be alleviated after some delay. If known, the length of the delay MAY be indicated in a Retry-After header. If no Retry-After is given, the client SHOULD handle the response as it would for a 500 response.

Note: The existence of the 503 status code does not imply that a
server must use it when becoming overloaded. Some servers may wish
to simply refuse the connection.



PS: с 204 add_header работает, но по доке он (Retry-After) должен идти с 503 (да ето и логично)
location / {
...
try_files .... @error503 ;
}

location @error503 {
error_log logs/qdvd.error.log debug ;
expires -1;
# 7*24*60*60 = 604800
add_header Retry-After 604800;
#return 503; # HTTP 503 Service Unavailable
return 204; # HTTP 204 No Content
}


спасибо,

Сергей

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

503 и add_header Retry-After

xinu September 29, 2010 10:34AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 157
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