diff --git a/Dockerfile b/Dockerfile index ad528bc..cd4d815 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN rm -rf ./* COPY index.html ./ COPY CV_Bastien_Chanot.html ./ COPY CV_Bastien_Chanot.pdf ./ +COPY favicon.svg favicon-32.png favicon.ico apple-touch-icon.png ./ # Non-root hardening: nginx:alpine already drops privileges to "nginx" user # for worker processes. Master runs as root only to bind port 80 inside diff --git a/nginx.conf b/nginx.conf index 05f327d..1927383 100644 --- a/nginx.conf +++ b/nginx.conf @@ -54,6 +54,13 @@ server { add_header Cache-Control "public, max-age=3600, must-revalidate"; } + # Long cache for favicon + image assets (rarely change). + location ~* \.(?:ico|svg|png|jpg|jpeg|gif|webp)$ { + expires 30d; + add_header Cache-Control "public, max-age=2592000, immutable"; + access_log off; + } + # Logs to stdout/stderr (default in nginx:alpine). access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log warn;