gzip working for 443 but not 80 in same listener?

lfisher nginx-forum at forum.nginx.org
Tue Apr 12 20:48:27 UTC 2016

I added port 80 in my listener.
# HTTPS server
server {
   listen 80;
   listen 443 ssl;

Gzip still works on 443, but css/js are not getting gzipped in port 80.

My nginx.conf has
    gzip  on;
        gzip_vary on;
        gzip_min_length 500;
        gzip_buffers  4 32k;
        gzip_comp_level 6;
        # gzip_proxied expired no-cache no-store private auth;
        gzip_proxied any;
        gzip_types text/plain text/css text/xml text/javascript
application/json application/javascript application/x-javascript
application/xml application/xml+rss;
        # gzip_types text/plain text/css application/json
application/x-javascript text/xml application/xml application/xml+rss
        gzip_disable "MSIE [1-6]\.";

I tried adding this but it didn't seem to help
        # it wasn't compressing for port 80
        gzip_http_version 1.0;

I can also see if I do
curl --header "Accept-Encoding: gzip,deflate,sdch" -sI


curl --header "Accept-Encoding: gzip,deflate,sdch" -sI

only the https shows
Content-Encoding: gzip

What am I missing??


Posted at Nginx Forum: https://forum.nginx.org/read.php?2,266128,266128#msg-266128

More information about the nginx mailing list