4

Here are my gzip setttings:

##
  # Gzip Settings
  ##

  gzip on;

  gzip_vary on;
  gzip_proxied any;
  gzip_comp_level 5;
  # Don't compress anything under 256 bytes
  gzip_min_length     256;
  # gzip_buffers 16 8k;
  gzip_http_version 1.1;
  gzip_disable  'MSIE [1-6]\.(?!.*SV1)';
  gzip_types
   application/atom+xml
   application/javascript
   application/json
   application/rss+xml
   application/vnd.ms-fontobject
   application/x-font-ttf
   application/x-font-opentype
   application/x-font-truetype
   application/x-javascript
   application/x-web-app-manifest+json
   application/xhtml+xml
   application/xml
   font/eot
   font/opentype
   font/otf
   image/svg+xml
   image/x-icon
   image/vnd.microsoft.icon
   text/css
   text/plain
   text/javascript
   text/x-component;

curl -IL https://example.com

HTTP/2 401

server: nginx

date: Fri, 28 Dec 2018 14:09:26 GMT

content-type: text/html; charset=UTF-8

content-length: 7326

www-authenticate: Basic realm="Privacy Enabled"

etag: "5c262af8-1c9e"

As you see the page is not enabled by gzip

How can I make 401 pages gzip enabled?

Goran Kutlaca
  • 2,014
  • 1
  • 12
  • 18
Mitesh Shah
  • 121
  • 9

1 Answers1

2

In your curl example the type is text/html which isn't in your gzip_types.

Add text/html to gzip_types and it should work.

MajicBob
  • 487
  • 2
  • 8