M7: hardening and final pass

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
lucioandClaude Opus 5.5 committed 2026-11-04 05:10:46 -08:00
1 parent 00ee2a6d12
commit ae898a2787
30 files changed
+878 -107

No files matched your search

+9 -1
View File
@@ -9,7 +9,7 @@ photos.luciochen.com {
respond @hotlink 403
@hidden path */.* *.gz
respond @hidden 404
error @hidden 404
@immutable path /t/* /og/* /assets/*
header @immutable Cache-Control "public, max-age=31536000, immutable"
@@ -30,4 +30,12 @@ photos.luciochen.com {
file_server {
precompressed gzip
}
handle_errors {
@notfound expression {err.status_code} == 404
rewrite @notfound /404.html
file_server {
precompressed gzip
}
}
}
+9
View File
@@ -19,6 +19,7 @@ server {
disable_symlinks off;
gzip_static on;
server_tokens off;
error_page 404 /404.html;
if ($request_method !~ ^(GET|HEAD)$) {
return 405;
@@ -28,6 +29,14 @@ server {
return 404;
}
location = /404.html {
internal;
add_header Cache-Control "public, max-age=60" always;
add_header Content-Security-Policy "default-src 'self'; img-src 'self' blob: data:; font-src 'self'; worker-src 'self'; frame-ancestors 'none'" always;
add_header X-Content-Type-Options nosniff always;
add_header Referrer-Policy strict-origin-when-cross-origin always;
}
location /t/ {
if ($luphoto_hotlink) {
return 403;