Read more

HowTo: Fix nginx not reloading with long gzip_types lines

Deleted user #4941
November 11, 2022Software engineer

When using many or very long entries of MIME-types that shoudl be gziped in gzip_types directives in nginx you might not be able to successfully reload the service and get this error message instead:

nginx: [emerg] could not build the test_types_hash, you should increase test_types_hash_bucket_size: 64
nginx: configuration file /etc/nginx/nginx.conf test failed

Option 1: Use gzip_types *;

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

If you don't care about which MIME type gets the gzip handling, just tell nginx that any MIME type should be gziped.

Especially for assets which might change, this is often the more sensible solution.

Option 2: Add types_hash_bucket_size Show archive.org snapshot

If you need to have only very specific, but still very long gzip_types you should just add types_hash_bucket_size Show archive.org snapshot to the location that causes the issue and increase it to a value that satisfies your needs.

Posted to makandra Operations (2022-11-11 14:29)