using return (http_rewrite) with etag

Maxim Dounin mdounin at mdounin.ru
Fri May 4 14:18:59 UTC 2018


Hello!

On Fri, May 04, 2018 at 10:04:02AM -0400, rsckp wrote:

> Hi guys,
> 
> In my configuration I'm using return directive from http_rewrite module. I'd
> also like to enable etag to speed things up. Sadly, so far didn't manage to
> get it to work. Is such configuration even possible?
> 
> If I hash out "return...", etag works like a charm.
> 
> server {
>         listen 80 default_server;
>         root /var/www/html;
>         index index.nginx-debian.html;
> 
>         default_type application/json;
>         etag on;
>         return 200 'xxx';
> }
> 
> Debian 9.4, nginx-light 1.10.3-1+deb9u1.
> 
> Thanks in advance for any thoughts.

The "etag" directive controls whether entity tags will be 
generated for static files.  Entity tags (as well as Last-Modified 
headers) are never generated for responses produced with the "return" 
directive.

-- 
Maxim Dounin
http://mdounin.ru/


More information about the nginx mailing list