Setting custom response headers

Igor Sysoev is at rambler-co.ru
Sun Jun 21 13:43:16 MSD 2009


On Tue, Jun 16, 2009 at 04:07:18AM -0400, ehudros2 wrote:

> Hi every, I'm back :)
> It seems I need the header to be set in a different format, and look like an expires date.
> it currently gives:
> User-Expires	Mon Apr 12 03:52:54 2010
> 
> When the desired outcome should be: 
> Mon, 12 Apr 2010 03:52:54 GMT
> 
> Is there a way I can format the date to the expires date format? I'm guessing it should be done in the perl function you suggested, but I have no knowledge in perl and searching for perl date formatting just flooded me with information I did not know how to use :)

You need to install Date::Manip module:

use Date::Manip qw(UnixDate);

$date = UnixDate(time(), "%a, %e %b %Y %H:%M:%S %z");


-- 
Igor Sysoev
http://sysoev.ru/en/





More information about the nginx mailing list