feat (infra): add web address for public Garage content

This commit is contained in:
Thomas Bishop 2025-08-12 16:24:38 +01:00
parent 4b2cf2be8d
commit 7612a56265

View file

@ -23,22 +23,32 @@ server {
# Security headers # Security headers
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
# Proxy Configuration
location / { # S3 API for authenticated operations
proxy_pass http://172.18.0.1:3900;
location /api/ {
proxy_pass http://172.18.0.1:3900/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
# CORS headers for web access # CORS headers for web access
add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS";
add_header Access-Control-Allow-Headers "Authorization, Content-Type"; add_header Access-Control-Allow-Headers "Authorization, Content-Type";
# Handle preflight requests # Handle preflight requests
if ($request_method = 'OPTIONS') { if ($request_method = 'OPTIONS') {
return 204; return 204;
} }
}
# Web endpoint for public file access
location / {
proxy_pass http://172.18.0.1:3902;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
} }
} }