Compare commits
2 Commits
769087ba4a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aaebd7ccd1 | ||
| 3f0a9f72d9 |
@@ -55,22 +55,6 @@ jobs:
|
||||
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no" \
|
||||
dist/ \
|
||||
ec2-user@${HOST}:/var/www/ark-library/
|
||||
rsync -avz \
|
||||
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no" \
|
||||
deploy/nginx-frontend-locations.inc \
|
||||
ec2-user@${HOST}:/tmp/ark-library-frontend.inc
|
||||
rsync -avz \
|
||||
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no" \
|
||||
deploy/nginx-frontend-native.conf \
|
||||
ec2-user@${HOST}:/tmp/ark-library-native.conf
|
||||
ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=no ec2-user@${HOST} bash -s <<'REMOTE'
|
||||
set -euo pipefail
|
||||
sudo mkdir -p /etc/nginx/snippets
|
||||
sudo install -m 0644 /tmp/ark-library-frontend.inc /etc/nginx/snippets/ark-library-frontend.inc
|
||||
sudo install -m 0644 /tmp/ark-library-native.conf /etc/nginx/conf.d/ark-library.conf
|
||||
rm -f /tmp/ark-library-frontend.inc /tmp/ark-library-native.conf
|
||||
sudo nginx -t && sudo systemctl reload nginx
|
||||
REMOTE
|
||||
echo ">>> $HOST 部署完成"
|
||||
}
|
||||
deploy_to "${{ secrets.FRONTEND_1_HOST }}" &
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
# Shared SPA locations. Browser calls same-origin /apnew/api/ + /uploads/ (VITE_API_PREFIX=/apnew).
|
||||
# Shared SPA locations. Browser calls same-origin /apnew/api/ (VITE_API_PREFIX=/apnew).
|
||||
# /apnew/api/ avoids ALB listener rule that sends /api/* to an unreachable backend target group.
|
||||
# Nginx proxies internally to ark-library-backend-1 (Tailscale); Host header for backend TLS.
|
||||
# Legacy /api/ locations are commented below for reference only.
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
gzip_proxied any;
|
||||
@@ -11,9 +12,10 @@ gzip_min_length 256;
|
||||
location ^~ /apnew/api/admin {
|
||||
return 404;
|
||||
}
|
||||
location ^~ /api/admin {
|
||||
return 404;
|
||||
}
|
||||
# Legacy same-origin /api admin block. Disabled while production uses /apnew/api.
|
||||
# location ^~ /api/admin {
|
||||
# return 404;
|
||||
# }
|
||||
location ^~ /admin {
|
||||
return 404;
|
||||
}
|
||||
@@ -32,19 +34,20 @@ location ^~ /apnew/api/ {
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
|
||||
location ^~ /api/ {
|
||||
proxy_pass https://100.93.205.19/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_set_header Host api.ark-library.com;
|
||||
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;
|
||||
client_max_body_size 512m;
|
||||
client_body_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
# Legacy same-origin /api proxy. Disabled while production uses /apnew/api.
|
||||
# location ^~ /api/ {
|
||||
# proxy_pass https://100.93.205.19/api/;
|
||||
# proxy_http_version 1.1;
|
||||
# proxy_ssl_server_name on;
|
||||
# proxy_set_header Host api.ark-library.com;
|
||||
# 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;
|
||||
# client_max_body_size 512m;
|
||||
# client_body_timeout 600s;
|
||||
# proxy_read_timeout 600s;
|
||||
# proxy_send_timeout 600s;
|
||||
# }
|
||||
|
||||
location ^~ /uploads/ {
|
||||
proxy_pass https://100.93.205.19/uploads/;
|
||||
|
||||
Reference in New Issue
Block a user