0

I'm zipping the front-end files in react and setting up a server in nginx to serve them.

Using gzip compression, I managed to get the server to return the front-end files normally, everything working correctly.

I find it difficult to do the same with brotli compression, I tried it in two ways.

  1. Serving nginx the files without compression and setting it to compress (brotli) before sending to the client.
  2. Compressing the front-end files with brotli via webpack and setting brotli_static in nginx. I have to solve the problem in this way i.e. the front end compresses the files

But none of the above ways work, below some relevant information.

Other points:

Some other simple way to serve brotli files so I can validate if the error is in nginx or webpack compression ?

I followed this link to install nginx and brotli modules

Webpack Config

Nginx Config

Front-end compression with gzip and nginx gzip_static on I just needed to enable gzip_static on;

enter image description here

brotli compression by nginx - brolti on; the "content-encoding" remained the same, it should change

enter image description here

Compressing files in brotli by webpack and setting brotli_static on in nginx

enter image description here

rick
  • 554
  • 6
  • 18

0 Answers0