B
B
bozuriciyu2019-10-25 14:48:51
Nginx
bozuriciyu, 2019-10-25 14:48:51

Why doesn't gzip work on proxy_pass?

API server behind nginx proxy. The application itself zips, but the API does not.
nginx.conf settings

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_types text/plain text/css application/json application/javascript application/x-j$...куча других
  gzip_min_length 256;

Read about proxy case but nothing helps https://docs.nginx.com/nginx/admin-guide/web-serve...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Shatokhin, 2019-10-25
@Sovigod

Try gzip_types *; and not a wagon, it’s not clear what. Well, check if there is Accept-Encoding: gzip in the request headers

G
grinat, 2019-10-25
@grinat

And where is gzip enabled, inside nginx which pass in the proxy? Just for gzip to work, you need to enable it at the very top level, for the one that looks on the Internet, otherwise it will unpack and give out without a gzip)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question