Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
2 votes
1 answer
7k views

Which static file types does Nginx generate ETags for by default?

In modern versions of Nginx, the ETag is automatically generated for static file types, even if you don't specifically enable the etag on in your location blocks or otherwise: https://nginx.org/en/...
Jesse Nickles's user avatar
3 votes
2 answers
5k views

How can I remove an accept-encoding request header in nginx?

The recent update to zlib due to a security hole appears to cause a major problem when serving PHP-FPM 8.0 via nginx on Ubuntu focal. Any requests with a gzip encoding fail right at the start of the ...
Synchro's user avatar
  • 3,319
1 vote
0 answers
1k views

Nginx not setting Vary header via add_header directive in server block?

I have gzip_vary on; I also have (inside a server section): add_header Vary Origin; Yet when I inspect headers sent, the Vary header only includes Accept-Encoding; if I remove the gzip_vary on; ...
artfulrobot's user avatar
  • 3,221
8 votes
2 answers
15k views

Force Nginx to send Content-Length header for static files with gzip?

We're running Nginx 0.7.65[-1ubuntu2.3]. I've just noticed that when serving local static files using an alias directive and gzip on, the Content-Length header is not getting sent. Since it's serving ...
David Eyk's user avatar
  • 697
5 votes
2 answers
27k views

Gzip compression with nginx

In my nginx.conf I have: gzip on; gzip_static on; gzip_buffers 16 8k; gzip_comp_level 9; gzip_http_version 1.0; gzip_min_length 1000; gzip_types text/plain text/css ...
Jerry's user avatar
  • 61
1 vote
0 answers
383 views

nginx: how to serve files in gzip format when client accepts "Accept-Encoding: gzip" and inflated otherwise?

I have a folder full of .gz files and would like to serve them transparently inflated if requested by a client that does not send Accept-Encoding: gzip in the request and as-is (gzip'd) otherwise. I ...
0xC0000022L's user avatar
  • 1,566
1 vote
1 answer
2k views

NGINX + GZIP - Altering Vary header to include User-Agent

Currently, when nginx is set to gzip outbound content as requested by the client, the "gzip_vary on" setting will set the following header: Vary: Accept-Encoding We would like to modify this to send ...
anonymous-one's user avatar
1 vote
1 answer
6k views

how to get nginx to gzip all files and add an expires header

recently got into VPS systems and installing them, and all that blah blah etc etc. So, I have a couple working websites, and on one of them I'm trying to really optimize it for speed. Using Yahoo's ...
user avatar
1 vote
1 answer
814 views

Is html or php header needed for gzip?

I use gzip module of nginx to compress documents. When gzip is enabled nginx will automatically send content-ending of gzip with HTTP headers, right? Without adding any PHP header header() or HTML ...
Googlebot's user avatar
  • 1,097