"X-Accel-Redirect" and Wordpress MU solution

rahul286 nginx-forum at nginx.us
Sat Nov 28 11:10:04 MSK 2009

> you can configure the expires via
> http://wiki.nginx.org/NginxHttpHeadersModule#expires

I did it and it worked.

But then I moved following 3 lines above "X-Accel-Redirect" code block in wordpress' blogs.php

@header( "Last-Modified: $last_modified GMT" );
@header( 'ETag: ' . $etag );
@header( 'Expires: ' . gmdate('D, d M Y H:i:s', time() + 100000000) . ' GMT' ); 

and it worked too. I received following response. 

HTTP/1.1 200 OK
Server: nginx/0.7.62
Date: Sat, 28 Nov 2009 08:00:11 GMT
Content-Type: image/jpeg
Content-Length: 27429
Last-Modified: Sun, 22 Nov 2009 20:58:54 GMT
Connection: keep-alive
Expires: Mon, 28 Jan 2013 17:46:51 GMT
Accept-Ranges: bytes

(Note: "Last Modified" line was present before above change)

I also found this particular thread very useful - http://marc.info/?l=nginx&m=120127279110733&w=2
and based on that only change nginx needs in its core is to add "Etag" header in ignore-list of "X-Accel-Redirect" code.

I may be wrong as this is my 6th day (only) on nginx and I never gone this far with my X (Apache) ;-)

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,25901,26205#msg-26205

More information about the nginx mailing list