I'm serving a static website from nginx that runs on a docker container which is based on nginx:alpine base image.
My DockerFile:
FROM nginx:alpine
COPY --from=angular-built app/dist/dayTwoApp /usr/share/nginx/html
COPY ./default.conf /etc/nginx/conf.d/default.conf
The default.conf file:
server {
listen 80;
gzip on;
gzip_vary on;
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
}
I see the vary : Accept-Encoding header in the response from a served html file (see below).
But for some reason i don't see the header in the js and css responses.
(*) Relevant references which didn't work:
Details of responses:
js files (also for css):