deploy: switch public entry to storyforge.hyzq.net

This commit is contained in:
kris
2026-03-23 18:19:52 +08:00
parent f093f72ae4
commit 17b419f8ef
14 changed files with 147 additions and 121 deletions

View File

@@ -1,8 +1,8 @@
# StoryForge `test.hyzq.net/storyforge` 公网入口
# StoryForge `storyforge.hyzq.net` 公网入口
当前公网接入不是把执行链整体迁到云服务器,而是:
1. 云服务器 `nginx` 提供 `https://test.hyzq.net/storyforge/`
1. 云服务器 `nginx` 提供 `https://storyforge.hyzq.net/`
2. 云服务器本地 `storyforge-web-v4.service` 承接静态前端
3. 本机 `collector-service` 继续承接业务与局域网执行引擎
4. 本机通过 SSH 反向隧道只桥接 API 到云服务器
@@ -20,10 +20,11 @@
## 云服务器 `nginx` 路由
- `/storyforge/` -> `127.0.0.1:19191`
- `/storyforge/v2/*` -> `127.0.0.1:18181`
- `/storyforge/openapi.json` -> `127.0.0.1:18181/openapi.json`
- `/storyforge/healthz` -> `127.0.0.1:18181/healthz`
- `/` -> `127.0.0.1:19191`
- `/v2/*` -> `127.0.0.1:18181`
- `/openapi.json` -> `127.0.0.1:18181/openapi.json`
- `/healthz` -> `127.0.0.1:18181/healthz`
- `/downloads/*` -> `127.0.0.1:18181/downloads/*`
## 当前优点

View File

@@ -0,0 +1,117 @@
server {
listen 80;
listen [::]:80;
server_name storyforge.hyzq.net;
location ^~ /.well-known/acme-challenge/ {
root /var/www/certbot;
default_type text/plain;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name storyforge.hyzq.net;
ssl_certificate /etc/letsencrypt/live/storyforge.hyzq.net/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/storyforge.hyzq.net/privkey.pem;
location = /healthz {
auth_basic off;
proxy_pass http://127.0.0.1:18181/healthz;
proxy_http_version 1.1;
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;
}
location = /openapi.json {
auth_basic off;
proxy_pass http://127.0.0.1:18181/openapi.json;
proxy_http_version 1.1;
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;
}
location = /api/v1/app/update/latest {
auth_basic off;
proxy_pass http://127.0.0.1:18181/api/v1/app/update/latest;
proxy_http_version 1.1;
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;
}
location ^~ /downloads/ {
auth_basic off;
proxy_pass http://127.0.0.1:18181/downloads/;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
location ^~ /v2/ {
auth_basic off;
proxy_pass http://127.0.0.1:18181/v2/;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location ^~ /docs {
auth_basic off;
proxy_pass http://127.0.0.1:18181;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location ^~ /redoc {
auth_basic off;
proxy_pass http://127.0.0.1:18181;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location / {
auth_basic off;
proxy_pass http://127.0.0.1:19191/;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
}

View File

@@ -1,101 +0,0 @@
location = /storyforge {
auth_basic off;
return 301 /storyforge/;
}
location = /storyforge/healthz {
auth_basic off;
proxy_pass http://127.0.0.1:18181/healthz;
proxy_http_version 1.1;
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;
}
location = /storyforge/openapi.json {
auth_basic off;
proxy_pass http://127.0.0.1:18181/openapi.json;
proxy_http_version 1.1;
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;
}
location = /storyforge/api/v1/app/update/latest {
auth_basic off;
proxy_pass http://127.0.0.1:18181/api/v1/app/update/latest;
proxy_http_version 1.1;
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;
}
location ^~ /storyforge/downloads/ {
auth_basic off;
proxy_pass http://127.0.0.1:18181/downloads/;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
}
location ^~ /storyforge/v2/ {
auth_basic off;
proxy_pass http://127.0.0.1:18181/v2/;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location ^~ /storyforge/docs {
auth_basic off;
rewrite ^/storyforge(/docs.*)$ $1 break;
proxy_pass http://127.0.0.1:18181;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location ^~ /storyforge/redoc {
auth_basic off;
rewrite ^/storyforge(/redoc.*)$ $1 break;
proxy_pass http://127.0.0.1:18181;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}
location ^~ /storyforge/ {
auth_basic off;
rewrite ^/storyforge/?(.*)$ /$1 break;
proxy_pass http://127.0.0.1:18191;
proxy_http_version 1.1;
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;
proxy_read_timeout 300s;
proxy_send_timeout 300s;
proxy_buffering off;
}