chore: 全量提交(推广页、宣传册、社交资源、视频与后台同步)
Made-with: Cursor
This commit is contained in:
@@ -79,3 +79,4 @@ sudo systemctl start nginx
|
||||
- **原因**:提供静态文件的 `server` 未把「不存在的路径」交给 `index.html`,Nginx 在磁盘上找不到 `some-page` 文件就返回 404。
|
||||
- **要求**:托管 **web 前台** 的站点必须使用 **`try_files $uri $uri/ /index.html;`**(见仓库 `nginx/web.conf` 与 `web/Dockerfile` 内嵌配置)。若你自建 Nginx,请对照修改后再 `nginx -t` 并重载。
|
||||
- **应用内 404**:在 SPA 已正确回退的前提下,未在后台发布的路径会由前端路由进入 **「页面不存在」** 页(`NotFound.vue`),与上述 nginx 404 不同。
|
||||
- **Compose 部署**:`web` 容器实际加载的是 **`deploy/web/default.conf`**(见 `docker-compose.yml` 挂载)。若线上仍对 `/test` 等返回 **nginx 404**,请把仓库里最新的 `deploy/web/default.conf` 同步到服务器对应路径后,执行 `docker compose restart web`(或重建 `yh_web` 容器)。
|
||||
|
||||
@@ -8,6 +8,13 @@ server {
|
||||
alias /verify-root/$1;
|
||||
}
|
||||
|
||||
location ^~ /assets/ {
|
||||
try_files $uri =404;
|
||||
access_log off;
|
||||
expires 7d;
|
||||
add_header Cache-Control "public, immutable";
|
||||
}
|
||||
|
||||
location = / {
|
||||
try_files /index.html =404;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user