server { listen 80; server_name _; root /usr/share/nginx/html; index index.html; server_tokens off; charset utf-8; gzip on; gzip_comp_level 6; gzip_types text/css text/csv application/javascript; auth_basic "Heatpump"; auth_basic_user_file /etc/nginx/.htpasswd; location / { try_files $uri $uri/ =404; include /etc/nginx/security-headers.conf; } # the CSV is mounted separately so it can be replaced without touching the app location = /history.csv { alias /data/history.csv; default_type text/csv; include /etc/nginx/security-headers.conf; } # unauthenticated liveness probe for the container healthcheck location = /healthz { auth_basic off; access_log off; default_type text/plain; return 200 "ok\n"; } }