Welcome! Log In Create A New Profile

Advanced

Re: why nginx is not compressing reply from proxied server?

pva
May 11, 2021 11:18AM
Err, After few hours of debugging, and writing email here, I've realised
that I have `gzip off;` in http {} block of configuration. After enabling
gzip in http block everything works fine. Is it correct behaviour that no
warning is issued with such configuration?

--
Peter.


On Tue, May 11, 2021 at 6:09 PM Peter Volkov <peter.volkov@gmail.com> wrote:

> Hi, I have a HTTP/1.0 web server that streams chunked content to clients.
> It does not gzip content so I would like to use nginx as reverse proxy to
> compress output from this server. Yet, no matter what I do nginx is not
> compressing results. For nginx I'm using following config:
>
> server {
> gzip on;
> gzip_comp_level 5;
> gzip_http_version 1.0;
> gzip_buffers 4 32k;
> gzip_min_length 0;
> gzip_types application/octet-stream;
> gzip_proxied any;
> gzip_vary on;
>
> proxy_buffering off;
>
> location / {
> proxy_pass http://10.239.254.17:9102;
> }
> }
>
> Then I'm using curl to request content:
>
> curl -v IP:9202 -H 'Accept-Encoding: deflate, gzip' -o output
> =====================================================
> > GET / HTTP/1.1
> > Host: IP:9202
> > User-Agent: curl/7.76.1
> > Accept: */*
> > Accept-Encoding: deflate, gzip
> >
> * Mark bundle as not supporting multiuse
> < HTTP/1.1 200 OK
> < Server: nginx/1.17.5
> < Date: Tue, 11 May 2021 15:05:56 GMT
> < Content-Type: application/octet-stream
> < Transfer-Encoding: chunked
> < Connection: keep-alive
> < Keep-Alive: timeout=20
> < Accept-Ranges: none
> < Cache-Control: no-cache
> <
> { [672 bytes data]
> 100 3343k 0 3343k 0 0 4866k 0 --:--:-- --:--:-- --:--:--
> 4859k^C
> =====================================================
>
> In result output is not compressed. What may cause this behaviour?
>
> This is how request/respond to downstream server looks like:
> curl -v http://10.239.254.17:9102
> * Trying 10.239.254.17:9102...
> * TCP_NODELAY set
> * Connected to 10.239.254.17 (10.239.254.17) port 9102 (#0)
> > GET / HTTP/1.1
> > Host: 10.239.254.17:9102
> > User-Agent: curl/7.66.0
> > Accept: */*
> >
> * Mark bundle as not supporting multiuse
> * HTTP 1.0, assume close after body
> < HTTP/1.0 200 OK
> < Server: UDP to HTTP tool with smart buffering
> < Accept-Ranges: none
> < Content-type: application/octet-stream
> < Cache-Control: no-cache
>
>
> Thanks in advance for any help,
> --
> Peter.
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

why nginx is not compressing reply from proxied server?

pva May 11, 2021 11:12AM

Re: why nginx is not compressing reply from proxied server?

pva May 11, 2021 11:18AM

Re: why nginx is not compressing reply from proxied server?

Maxim Dounin May 11, 2021 05:24PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 307
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