Enabling gzip within nginx?

I’m trying to enable gzip within nginx. The tutorials I’ve come across say it’s as simple as adding some gzip configurations to nginx.conf:
http {
gzip on;
gzip_disable “msie6”;

gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_min_length 256;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/vnd.ms-fontobject application/x-font-ttf font/opentype image/svg+xml image/x-icon;
}

But this doesn’t seem to do the trick (I’ve tried restarting the server – btw, nginx doesn’t show up within the box after ssh’ing and running service --status-all?)

The curl test / chrome headers don’t show gzip running:
cycle@BBP$ curl -H “Accept-Encoding: gzip” -I http://local-site.dev
HTTP/1.1 200 OK
Server: nginx/1.10.1
Date: Fri, 24 Feb 2017 12:22:05 GMT
Content-Type: text/html; charset=UTF-8
Connection: keep-alive
Vary: Accept-Encoding
X-Powered-By: PHP/7.0.3
Link: http:/local-site.dev/wp-json/; rel="https://api.w.org/"
Link: http://local-site.dev/; rel=shortlink

Hey Brian,

You’re not seeing these changes specifically because there’s an additional nginx layer that’s the “router” that routes the requests to the specific Docker container.

I’ve made note of this and we’ll make sure gzip is enabled for the router in an upcoming release.

I was trying to do the same thing but could not enable it. Just wondering is it still not added ? I am on Version 1.4.2 (1.4.2).

Hi @sjaved87,

This is something we’ll have to do on our end. It’s currently in our pipeline.

With that said, you most likely won’t see much of a performance gain locally with gzip. You will benefit more from gzip when the data is being transferred over the internet.