NGINX gzip per virtualhost?
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I know here are a lot of "similar" Q's, but anyway...
So â I have a nginx.conf
with gzip on;
. It's a new, clean Linux server, nothing yet done here.
Using curl
â I can see gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:26:40 GMT
Content-Type: text/html
Last-Modified: Wed, 19 Sep 2018 13:56:35 GMT
Connection: keep-alive
ETag: W/"5ba25593-264"
Content-Encoding: gzip
Now â I'm adding simple config conf.d/gzip.setevoy.kiev.ua.conf
:
server
listen 80;
server_name gzip.setevoy.kiev.ua;
root /var/www/etag;
index index.html;
And now â no gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:28:00 GMT
Content-Type: text/html
Content-Length: 7
Last-Modified: Wed, 19 Sep 2018 13:58:46 GMT
Connection: keep-alive
ETag: "5ba25616-7"
Accept-Ranges: bytes
Adding gzip on;
directly to the conf.d/gzip.setevoy.kiev.ua.conf
didn't help. Same if set gzip off;
in the nginx.conf
and gzip on;
to the virtualhost's conf.
What I'm doing wrong here?
P.S. gzip_vary on;
, gzip_types *
etc., didn't help either.
nginx gzip
add a comment |Â
up vote
0
down vote
favorite
I know here are a lot of "similar" Q's, but anyway...
So â I have a nginx.conf
with gzip on;
. It's a new, clean Linux server, nothing yet done here.
Using curl
â I can see gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:26:40 GMT
Content-Type: text/html
Last-Modified: Wed, 19 Sep 2018 13:56:35 GMT
Connection: keep-alive
ETag: W/"5ba25593-264"
Content-Encoding: gzip
Now â I'm adding simple config conf.d/gzip.setevoy.kiev.ua.conf
:
server
listen 80;
server_name gzip.setevoy.kiev.ua;
root /var/www/etag;
index index.html;
And now â no gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:28:00 GMT
Content-Type: text/html
Content-Length: 7
Last-Modified: Wed, 19 Sep 2018 13:58:46 GMT
Connection: keep-alive
ETag: "5ba25616-7"
Accept-Ranges: bytes
Adding gzip on;
directly to the conf.d/gzip.setevoy.kiev.ua.conf
didn't help. Same if set gzip off;
in the nginx.conf
and gzip on;
to the virtualhost's conf.
What I'm doing wrong here?
P.S. gzip_vary on;
, gzip_types *
etc., didn't help either.
nginx gzip
1
IMO this is worth leaving open because it's a good catch on a subtle problem.
â roaima
Sep 24 at 8:50
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I know here are a lot of "similar" Q's, but anyway...
So â I have a nginx.conf
with gzip on;
. It's a new, clean Linux server, nothing yet done here.
Using curl
â I can see gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:26:40 GMT
Content-Type: text/html
Last-Modified: Wed, 19 Sep 2018 13:56:35 GMT
Connection: keep-alive
ETag: W/"5ba25593-264"
Content-Encoding: gzip
Now â I'm adding simple config conf.d/gzip.setevoy.kiev.ua.conf
:
server
listen 80;
server_name gzip.setevoy.kiev.ua;
root /var/www/etag;
index index.html;
And now â no gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:28:00 GMT
Content-Type: text/html
Content-Length: 7
Last-Modified: Wed, 19 Sep 2018 13:58:46 GMT
Connection: keep-alive
ETag: "5ba25616-7"
Accept-Ranges: bytes
Adding gzip on;
directly to the conf.d/gzip.setevoy.kiev.ua.conf
didn't help. Same if set gzip off;
in the nginx.conf
and gzip on;
to the virtualhost's conf.
What I'm doing wrong here?
P.S. gzip_vary on;
, gzip_types *
etc., didn't help either.
nginx gzip
I know here are a lot of "similar" Q's, but anyway...
So â I have a nginx.conf
with gzip on;
. It's a new, clean Linux server, nothing yet done here.
Using curl
â I can see gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:26:40 GMT
Content-Type: text/html
Last-Modified: Wed, 19 Sep 2018 13:56:35 GMT
Connection: keep-alive
ETag: W/"5ba25593-264"
Content-Encoding: gzip
Now â I'm adding simple config conf.d/gzip.setevoy.kiev.ua.conf
:
server
listen 80;
server_name gzip.setevoy.kiev.ua;
root /var/www/etag;
index index.html;
And now â no gzip
enabled:
$ curl -I -H "Accept-Encoding: gzip,deflate" gzip.setevoy.kiev.ua/
HTTP/1.1 200 OK
Server: nginx/1.10.3
Date: Wed, 19 Sep 2018 14:28:00 GMT
Content-Type: text/html
Content-Length: 7
Last-Modified: Wed, 19 Sep 2018 13:58:46 GMT
Connection: keep-alive
ETag: "5ba25616-7"
Accept-Ranges: bytes
Adding gzip on;
directly to the conf.d/gzip.setevoy.kiev.ua.conf
didn't help. Same if set gzip off;
in the nginx.conf
and gzip on;
to the virtualhost's conf.
What I'm doing wrong here?
P.S. gzip_vary on;
, gzip_types *
etc., didn't help either.
nginx gzip
nginx gzip
edited Sep 25 at 2:16
G-Man
11.9k92658
11.9k92658
asked Sep 19 at 14:31
setevoy
5141823
5141823
1
IMO this is worth leaving open because it's a good catch on a subtle problem.
â roaima
Sep 24 at 8:50
add a comment |Â
1
IMO this is worth leaving open because it's a good catch on a subtle problem.
â roaima
Sep 24 at 8:50
1
1
IMO this is worth leaving open because it's a good catch on a subtle problem.
â roaima
Sep 24 at 8:50
IMO this is worth leaving open because it's a good catch on a subtle problem.
â roaima
Sep 24 at 8:50
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
OK, that was simple - but I wasted a lot of time trying to figure it out. Maybe will be helpful for somebody else.
Everything was good with configs, but let's take a look on to the documentation:
Syntax: gzip_min_length length;
Default: gzip_min_length 20;
And guess what? I tested it with index.html
with one word added... Obviously, its size was < 20 bytes so NGINX didn't apply gzip
on it.
So I just added gzip_min_length 0;
to the nginx.conf
- and all works now.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
OK, that was simple - but I wasted a lot of time trying to figure it out. Maybe will be helpful for somebody else.
Everything was good with configs, but let's take a look on to the documentation:
Syntax: gzip_min_length length;
Default: gzip_min_length 20;
And guess what? I tested it with index.html
with one word added... Obviously, its size was < 20 bytes so NGINX didn't apply gzip
on it.
So I just added gzip_min_length 0;
to the nginx.conf
- and all works now.
add a comment |Â
up vote
2
down vote
OK, that was simple - but I wasted a lot of time trying to figure it out. Maybe will be helpful for somebody else.
Everything was good with configs, but let's take a look on to the documentation:
Syntax: gzip_min_length length;
Default: gzip_min_length 20;
And guess what? I tested it with index.html
with one word added... Obviously, its size was < 20 bytes so NGINX didn't apply gzip
on it.
So I just added gzip_min_length 0;
to the nginx.conf
- and all works now.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
OK, that was simple - but I wasted a lot of time trying to figure it out. Maybe will be helpful for somebody else.
Everything was good with configs, but let's take a look on to the documentation:
Syntax: gzip_min_length length;
Default: gzip_min_length 20;
And guess what? I tested it with index.html
with one word added... Obviously, its size was < 20 bytes so NGINX didn't apply gzip
on it.
So I just added gzip_min_length 0;
to the nginx.conf
- and all works now.
OK, that was simple - but I wasted a lot of time trying to figure it out. Maybe will be helpful for somebody else.
Everything was good with configs, but let's take a look on to the documentation:
Syntax: gzip_min_length length;
Default: gzip_min_length 20;
And guess what? I tested it with index.html
with one word added... Obviously, its size was < 20 bytes so NGINX didn't apply gzip
on it.
So I just added gzip_min_length 0;
to the nginx.conf
- and all works now.
edited Sep 24 at 12:45
answered Sep 20 at 9:41
setevoy
5141823
5141823
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470034%2fnginx-gzip-per-virtualhost%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
IMO this is worth leaving open because it's a good catch on a subtle problem.
â roaima
Sep 24 at 8:50