I tried setting up gzip compression for server side included files in nginx.
I have enabled gzip compression in nginx.conf
This is the configuration that I have used:
I also have ssi on at the server block level.
When I check the response headers for SSI files, it does not show content-encoding header. However, when I check the response header for a .css file or any other file that does not have server side include in it and served from the same server, I get the content-encoding header as gzip.
Therefore, I get a "enable text compression" suggestion in Chrome lighthouse for the SSI files.
I have pasted the response headers from Chrome
For the SSI file:
alt-svc: clear cache-control: no-cache content-type: text/html date: Wed, 23 Jan 2019 05:03:31 GMT server: nginx/1.14.0 (Ubuntu) status: 200 vary: Accept-Encoding via: 1.1 google
For the CSS file:
age: 386917 alt-svc: clear cache-control: max-age=31536000,public, no-transform **content-encoding: gzip** content-length: 30438 content-type: text/css date: Fri, 18 Jan 2019 16:30:06 GMT expires: Sat, 18 Jan 2020 16:30:06 GMT server: nginx/1.14.0 (Ubuntu) status: 200 vary: Accept-Encoding via: 1.1 google
What settings should be done to enable gzip compression for SSI files?
Could you please help me solve this?
Thanks for your time.