[nginx_gzip_static] Necessity to create empty file with always option.

Valentin V. Bartenev vbart at nginx.com
Tue Nov 17 18:29:00 UTC 2015

On Tuesday 17 November 2015 19:15:43 Richard Fussenegger wrote:
> Hi guys!
> I have the following weird situation: Several files with .gz extension
> are on disk and I have a location were requests are processed that do
> not include it, so I set the option gzip_static to always and also
> installed the gunzip module. The problem is, I still need to create
> EMPTY files without the .gz extension on disk for everything to work as
> expected. Expected is that gunzip extracts the archives if no GZIP
> support is announced by the client and nginx directly streams the
> response if the client did.
> The configuration is fairly easy:
>     location /var/files {
>         internal;
>         gunzip on;
>         gzip_proxied any;
>         gzip_static always;
>         aio on;
>         sendfile off;
>         tcp_nodelay on;
>         tcp_nopush off;
>         try_files $uri =404;
>     }

Why do you have this useless "try_files $uri =404;" directive here?
It causes your problem.

Please note, that this mailing list is for developers.  You should ask
questions in user's one: http://mailman.nginx.org/mailman/listinfo/nginx

  wbr, Valentin V. Bartenev

More information about the nginx-devel mailing list