diff --git a/nginx/s3.conf b/nginx/s3.conf index a649c84..8e61925 100644 --- a/nginx/s3.conf +++ b/nginx/s3.conf @@ -1,17 +1,17 @@ -# ========= S3 API 主站域名 ========== +# ========= S3 API 主站域名 ========== upstream cloud { server 127.0.0.1:9000; # MinIO S3 API keepalive 64; } -# ========= 控制台子域名 ========== +# ========= 控制台子域名 ========== upstream admin { server 127.0.0.1:9001; # MinIO 控制台 Web UI keepalive 64; } # ---------------------------- -# ✅ S3 API 域名:https://s3.szaiai.com +# ✅ 控制台路径反代,保留原逻辑:https://s3.szaiai.com/s3 # ---------------------------- server { server_name s3.szaiai.com; @@ -45,7 +45,7 @@ server { } # ---------------------------- -# ✅ 控制台子域名:https://console.szaiai.com +# ✅ 控制台 UI 域名:https://console.szaiai.com # ---------------------------- server { server_name console.szaiai.com; @@ -75,3 +75,32 @@ server { server_name console.szaiai.com; return 301 https://$host$request_uri; } + +# ---------------------------- +# ✅ 新增:干净的 API 域名,用于 mc/share/download:https://api.szaiai.com +# ---------------------------- +server { + server_name api.szaiai.com; + + client_max_body_size 5G; + + location / { + proxy_pass http://cloud/; + 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; + } + + listen 443 ssl; + ssl_certificate /etc/letsencrypt/live/api.szaiai.com/fullchain.pem; + ssl_certificate_key /etc/letsencrypt/live/api.szaiai.com/privkey.pem; + include /etc/letsencrypt/options-ssl-nginx.conf; + ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; +} + +server { + listen 80; + server_name api.szaiai.com; + return 301 https://$host$request_uri; +}