nginx-proxy / nginx-proxy/nginx-proxy

gzip_types has no effect without setting gzip and gzip_proxied

Open
#139 23 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
19.9k
Forks
3k
Avg merge
2d 11h
Merged PRs (30d)
1

Description

I was just reading the NGINX documentation for the various directives in the nginx-proxy template because NGINX is all new to me (I've switched to nginx-proxy from a handcrafted Apache configuration).

I noted that gzip is off by default (http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip). I checked the global NGINX configuration included in the Docker nginx image* and found that there are no overrides there so it really is off. I also confirmed empirically** that gzip is not being enabled using curl.

I would open a PR that adds gzip on above gzip_types, but I note that gzip_proxied must also be set to something other than its default of off for gzip to actually be enabled; there are several options (http://nginx.org/en/docs/http/ngx_http_gzip_module.html#gzip_proxied) and it's not clear to me what would be most appropriate for nginx-proxy's template.

Assuming I've not missed something, perhaps this issue can be used to discuss and agree on a sensible value for gzip_proxied, and then a PR can be made?

130 david@maple:~/Deploy/proxy/docker-gen⟫ sudo docker run -it --rm nginx:1 bash
root@7e1d979519b4:/# cd /etc/nginx/
root@7e1d979519b4:/etc/nginx# ls
conf.d  fastcgi_params  koi-utf  koi-win  mime.types  nginx.conf  scgi_params  uwsgi_params  win-utf
root@7e1d979519b4:/etc/nginx# cat nginx.conf | grep gzip
    #gzip  on;

**

david@ash:~$ curl -I -H "Accept-Encoding: gzip,deflate" https://www.dhpiggott.net
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 04 Apr 2015 09:56:48 GMT
Content-Type: text/html
Content-Length: 3730
Connection: keep-alive
Last-Modified: Fri, 03 Apr 2015 22:46:34 GMT
ETag: "551f184a-e92"
Accept-Ranges: bytes
Strict-Transport-Security: max-age=15768000

compare to the result when I add gzip on and gzip_proxied any to my template:

david@ash:~$ curl -I -H "Accept-Encoding: gzip,deflate" https://www.dhpiggott.net
HTTP/1.1 200 OK
Server: nginx
Date: Sat, 04 Apr 2015 09:59:20 GMT
Content-Type: text/html
Connection: keep-alive
Last-Modified: Fri, 03 Apr 2015 22:46:34 GMT
ETag: W/"551f184a-e92"
Strict-Transport-Security: max-age=15768000
Content-Encoding: gzip

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the nginx-proxy template and the NGINX gzip and gzip_proxied documentation, then reproduce the current behavior with the curl commands shown in the issue. Review the discussion to identify an agreed gzip_proxied value; done means the template uses the agreed settings and proxied responses are gzip-encoded when requested.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
infrastructure
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.