CI / test (pull_request) Successful in 41s
With X-Content-Type-Options: nosniff a browser refuses a script whose type is not exactly a JavaScript type. Declare the types of every file the site build writes (html, js, json, csv, css, svg, plus yaml/py/md as text) instead of relying on the base image's mime.types, so the page loads whatever that list contains. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UCzTd31GphpMXDhQqWrCMQ
45 lines
1.7 KiB
Nginx Configuration File
45 lines
1.7 KiB
Nginx Configuration File
# The Atlas is plain static files. The data changes daily, so browsers revalidate rather than cache blindly.
|
|
# Replaces the image's conf.d/default.conf (it listens on 8080 and runs as UID 65532).
|
|
|
|
# Temp files under /tmp (an emptyDir in the pod), so the root filesystem can be read-only
|
|
client_body_temp_path /tmp/client_body;
|
|
proxy_temp_path /tmp/proxy;
|
|
fastcgi_temp_path /tmp/fastcgi;
|
|
uwsgi_temp_path /tmp/uwsgi;
|
|
scgi_temp_path /tmp/scgi;
|
|
|
|
server {
|
|
listen 8080;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
charset utf-8;
|
|
server_tokens off;
|
|
|
|
# The image logs to files under /var/log/nginx; send access logs to the pod log instead
|
|
access_log /dev/stdout main;
|
|
|
|
# Every file type the site build writes, declared here rather than left to the image's mime.types: with nosniff
|
|
# (below) a browser refuses a script that is not served as JavaScript. The page's data and source files show as
|
|
# text. Anything else falls back to the image's list.
|
|
include /etc/nginx/mime.types;
|
|
types {
|
|
text/html html;
|
|
application/javascript js mjs;
|
|
application/json json;
|
|
text/csv csv;
|
|
text/css css;
|
|
image/svg+xml svg;
|
|
text/plain yaml py md txt;
|
|
}
|
|
|
|
gzip on;
|
|
gzip_types text/plain text/css text/csv text/javascript application/javascript application/json;
|
|
|
|
add_header Cache-Control "no-cache" always;
|
|
add_header X-Content-Type-Options "nosniff" always;
|
|
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
|
|
|
|
location = /healthz { access_log off; default_type text/plain; return 200 "ok\n"; }
|
|
location / { try_files $uri $uri/ =404; }
|
|
}
|