feat(web): 移除 Docker 与反代部署,改为 Linux 业务服务并自带管理端托管
需求变更:Web 端只保留业务需求,反向代理交由另外的服务处理, 本项目仅提供 IIS / nginx 反代说明文档,不部署反代。 主要改动: - web-server: 新增管理端静态托管(ADMIN_DIR、SPA 深链接回退), 反代因此只需一条全匹配转发规则;新增 adminDir 配置项 - deploy/install.sh: 删除 nginx 安装与站点配置逻辑,改为原生 Linux 服务部署(systemd → OpenRC → SysVinit → 后台进程四级降级), 打印反代交接指引 - deploy/ctl.sh: 启停/状态/日志脚本 - deploy/proxy/: 新增反代说明文档(README.md、nginx.conf.example、 web.config.example),标注上传上限与超时必须同步调整 - 删除 deploy/nginx/、web-server/admin/nginx.conf、Dockerfile、 docker-compose.yml、.dockerignore - scripts/package-release.sh: 锚定排除规则 + 产物完整性校验 - 文档同步:README.txt、DSH.md、project.yaml、tasks/008、tasks/010
This commit is contained in:
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
============================================================
|
||||
OpenDance Studio Web 服务端 —— IIS 反向代理样例
|
||||
|
||||
说明:本 Web 端不自带反向代理。本文件是**给你的反代服务参考**的配置样例。
|
||||
|
||||
前置条件(IIS 默认都不带,需自行安装):
|
||||
1. URL Rewrite 模块
|
||||
https://www.iis.net/downloads/microsoft/url-rewrite
|
||||
2. Application Request Routing (ARR)
|
||||
https://www.iis.net/downloads/microsoft/application-request-routing
|
||||
3. 启用 ARR 代理(否则会 404.4):
|
||||
IIS 管理器 → 服务器节点 → Application Request Routing Cache
|
||||
→ Server Proxy Settings → 勾选 Enable proxy
|
||||
|
||||
放置位置:IIS 站点根目录下的 web.config
|
||||
|
||||
后端(NestJS)自带管理端页面与 SPA 回退,所以这里只需一条全匹配重写规则,
|
||||
不需要在 IIS 上再配置默认文档或 URL Rewrite 的 SPA 回退。
|
||||
============================================================
|
||||
-->
|
||||
<configuration>
|
||||
<system.webServer>
|
||||
|
||||
<rewrite>
|
||||
<rules>
|
||||
<!-- 全部请求转发给后端:管理端页面 / 前端深链接 / api / health / static / contracts -->
|
||||
<rule name="OpenDanceReverseProxy" stopProcessing="true">
|
||||
<match url="(.*)" />
|
||||
<action type="Rewrite" url="http://127.0.0.1:3000/{R:1}" />
|
||||
</rule>
|
||||
</rules>
|
||||
<!-- 若需要 HTTPS 终止,取消下面一段注释(IIS 侧装证书) -->
|
||||
<!--
|
||||
<outboundRules>
|
||||
<rule name="RewriteRedirectToHttps" preCondition="IsRedirect">
|
||||
<match serverVariable="RESPONSE_Location" pattern="^http://(.*)" />
|
||||
<action type="Rewrite" value="https://{R:1}" />
|
||||
</rule>
|
||||
<preConditions>
|
||||
<preCondition name="IsRedirect">
|
||||
<add input="{RESPONSE_STATUS}" pattern="3\d\d" />
|
||||
</preCondition>
|
||||
</preConditions>
|
||||
</outboundRules>
|
||||
-->
|
||||
</rewrite>
|
||||
|
||||
<security>
|
||||
<requestFiltering>
|
||||
<!-- ★ 上传上限 512 MiB。IIS 默认约 28.6 MB,不改大文件上传必失败(413) -->
|
||||
<requestLimits maxAllowedContentLength="536870912" />
|
||||
</requestFiltering>
|
||||
</security>
|
||||
|
||||
<!-- ★ 与上一条配合:SSL 场景下请求体预读缓冲,默认仅 48 KB,不改仍会失败 -->
|
||||
<serverRuntime uploadReadAheadSize="536870912" />
|
||||
|
||||
<!-- 保留原始 Host 头,后端日志与重定向才正确 -->
|
||||
<proxy preserveHostHeader="true" />
|
||||
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<remove name="X-Powered-By" />
|
||||
</customHeaders>
|
||||
</httpProtocol>
|
||||
|
||||
</system.webServer>
|
||||
</configuration>
|
||||
<!--
|
||||
┌──────────────────────────────────────────────────────────────┐
|
||||
│ 两个最常踩的坑 │
|
||||
├──────────────────────────────────────────────────────────────┤
|
||||
│ 1. 代理超时是**服务器级**配置,不在 web.config 里。 │
|
||||
│ ARR 默认 120 秒,上传大模型会中途断开。改 │
|
||||
│ C:\Windows\System32\inetsrv\config\applicationHost.config │
|
||||
│ 的 <webProxy> 节点: │
|
||||
│ <webProxy enabled="true" timeout="00:05:00" /> │
|
||||
│ 改完 iisreset 或重启 W3SVC。 │
|
||||
│ │
|
||||
│ 2. requestLimits 与 serverRuntime 必须**同时**改。 │
|
||||
│ 只改前者,HTTPS 下仍会因 uploadReadAheadSize 太小而失败。 │
|
||||
└──────────────────────────────────────────────────────────────┘
|
||||
-->
|
||||
Reference in New Issue
Block a user