Welcome! Log In Create A New Profile

Advanced

Re: Revisiting the long-overdue "TODO always gunzip" in ngx_http_gunzip_filter_module.c

All files from this thread

File Name File Size   Posted by Date  
002_force_gunzip.patch 1.6 KB open | download J.R. 10/20/2019 Read message
Maxim Dounin
October 21, 2019 02:40PM
Hello!

On Mon, Oct 21, 2019 at 12:49:38PM -0500, J.R. wrote:

> > Also note that if you really need to force gunziping for some reason,
> > you can do so out of the box by using an additional local proxying
> > layer with appropriate "proxy_set_header Accept-Encoding".
>
> Yes, that is how I had it configured before patching, all content
> between nginx and the upstream servers was uncompressed using the
> directive you mentioned, but the goal was to have the data between the
> two servers compressed to reduce network traffic.

Well, it looks like I've failed to explain. You can have things
compressed between servers and then decompressed on the frontend
server. To do so, you can configure additional proxying on the
frontend server, for example:

server {
listen 80;
server_name example.com;

location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Accept-Encoding "";
}
}

server {
listen 8080;
server_name gunzip.example.com;

location / {
proxy_pass http://backend;
proxy_set_header Accept-Encoding "gzip";
gunzip on;
}
}

With such a configuration all traffic between the frontend server
and the backend servers can be compressed using gzip. Yet
everything in the first server block isn't compressed, and can be
processed by sub filter and so on.

> Yes, I also read your comments from 2013, but after looking over the
> current gunzip module code, I can't find any flag that another module
> could set to force decompression? Or did I miss it buried somewhere?

It wasn't implemented. Rather, it is something I think should be
implemented if we want to process/modify compressed responses
within nginx.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Revisiting the long-overdue "TODO always gunzip" in ngx_http_gunzip_filter_module.c Attachments

J.R. October 20, 2019 01:02PM

Re: Revisiting the long-overdue "TODO always gunzip" in ngx_http_gunzip_filter_module.c

Maxim Dounin October 21, 2019 01:08PM

Re: Revisiting the long-overdue "TODO always gunzip" in ngx_http_gunzip_filter_module.c

J.R. October 21, 2019 01:50PM

Re: Revisiting the long-overdue "TODO always gunzip" in ngx_http_gunzip_filter_module.c

Maxim Dounin October 21, 2019 02:40PM

Re: Revisiting the long-overdue "TODO always gunzip" in ngx_http_gunzip_filter_module.c

J.R. October 23, 2019 12:14PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 287
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready