How to set Retry-After for 503?

Gena Makhomed gmm at csdoc.com
Fri Jul 3 23:49:41 MSD 2009


On Friday, July 3, 2009 at 21:01:18, tmiskiew wrote:

t> Can you please explain how to set Retry-After for the status code 503?

workaround via apache/mod_php:

> cat 503.php
<?php

header( 'HTTP/1.0 503 Service Temporarily Unavailable' );
header( 'Retry-After: 600' );
header( 'Content-Type: text/html' );

print(
        "<html>"."\x0d\x0a".
        "<head><title>503 Service Temporarily Unavailable</title></head>"."\x0d\x0a".
        "<body bgcolor=\"white\">"."\x0d\x0a".
        "<center><h1>503 Service Temporarily Unavailable</h1></center>"."\x0d\x0a".
        "<hr><center>nginx</center>"."\x0d\x0a".
        "</body>"."\x0d\x0a".
        "</html>"."\x0d\x0a"
    );

> cat headers
HTTP/1.1 503 Service Temporarily Unavailable
Server: nginx
Date: Fri, 03 Jul 2009 19:48:11 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Retry-After: 600
Content-Length: 206

-- 
Best regards,
 Gena






More information about the nginx mailing list