From 7612a56265be5681060475e5ddb87cae165c1627 Mon Sep 17 00:00:00 2001 From: thomasabishop Date: Tue, 12 Aug 2025 16:24:38 +0100 Subject: [PATCH] feat (infra): add web address for public Garage content --- proxy/nginx/conf.d/s3.conf | 28 +++++++++++++++++++--------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/proxy/nginx/conf.d/s3.conf b/proxy/nginx/conf.d/s3.conf index 43b2b0d..bd8f973 100644 --- a/proxy/nginx/conf.d/s3.conf +++ b/proxy/nginx/conf.d/s3.conf @@ -23,22 +23,32 @@ server { # Security headers add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; - # Proxy Configuration - location / { - proxy_pass http://172.18.0.1: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; - proxy_set_header X-Forwarded-Proto $scheme; + # S3 API for authenticated operations + + location /api/ { + proxy_pass http://172.18.0.1:3900/; + proxy_set_header Host $host; + # CORS headers for web access add_header Access-Control-Allow-Origin *; add_header Access-Control-Allow-Methods "GET, POST, PUT, DELETE, OPTIONS"; add_header Access-Control-Allow-Headers "Authorization, Content-Type"; - - # Handle preflight requests + + # Handle preflight requests if ($request_method = 'OPTIONS') { 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; } }