503 и add_header Retry-After

xinu xinu на list.ru
Ср Сен 29 18:32:54 MSD 2010


добрый день,

хотел приписать к 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