Files
hantim-server/docker/nginx/conf.d/s3.hantim.net.conf
T
timothykim cc07a34489
Deploy nginx / deploy (push) Successful in 3s
Deploy nginx / test (push) Successful in 54s
fix nginx security headers not being applied to https responses
nginx add_header inheritance meant X-Content-Type-Options and X-Frame-Options
were silently dropped from all https server blocks. moved all security headers
into a shared snippet (security-headers.inc) included per server block. added
pytest-based header verification that auto-discovers sites from conf files.
2026-03-20 15:11:56 -04:00

36 lines
807 B
Plaintext

# Garage S3 API
server {
listen 80;
listen [::]:80;
server_name s3.hantim.net;
location /.well-known/acme-challenge/ {
root /var/www/certbot;
}
location / {
return 301 https://s3.hantim.net$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on;
server_name s3.hantim.net;
ssl_certificate /etc/letsencrypt/live/s3.hantim.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/s3.hantim.net/privkey.pem;
include /etc/nginx/conf.d/security-headers.inc;
client_max_body_size 100M;
location / {
proxy_pass http://garage:3900;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}