security: compose必填变量+环回绑定+nginx安全头/admin内网化;产物去跟踪88项;冻结规格+审计+BLOCKED runbook落盘

This commit is contained in:
2026-09-16 18:18:42 +08:00
parent 6b8770b488
commit 749ad91459
95 changed files with 210 additions and 20 deletions
+9
View File
@@ -18,3 +18,12 @@ node_modules/
shots/
docker.env
backups/
# 构建产物与临时取证文件(只对新增生效,已跟踪历史需显式 git rm --cached,见报告命令清单)
*.log
*.png
*.tar.gz
__pycache__/
*.pyc
dist/
shots/
Binary file not shown.

Before

Width:  |  Height:  |  Size: 242 B

+61
View File
@@ -0,0 +1,61 @@
# BLOCKED 可执行 Runbook(未执行,需拍板)
> 状态:只读落盘,不执行;不输出密钥原文;不提交 git;未改远端。
> 拍板格式:`B1暂不 / B2暂不 / B3暂不 / B5暂不 / B6暂不` 或注明哪项执行。
## B1 线上密钥轮换(需停机窗口)
- 前置:停机窗口 + 远端 docker.env 备份 + 回滚方案。
- 步骤(远端执行,占位符,非真实值):
1. `cp docker.env docker.env.bak.YYYYMMDD-HHMM`
2. 生成三段随机值分别写入 `DJANGO_SECRET_KEY` / `POSTGRES_PASSWORD` / `REDIS_PASSWORD`(本地生成后粘贴,不在聊天输出原文)
3. `docker compose --project-name chunyu -f docker-compose.yml -f docker-compose.server.yml restart backend postgres redis`
4. 验证:登录 /user/login、`/api/apidirectory/categories/` 200、Celery 心跳
5. 失败回滚:`cp docker.env.bak.* docker.env && restart` 同上
- 阻塞:缺停机窗口确认。
## B2 生产 TLS/HSTS(需域名+证书方案)
- 前置:域名 + 证书来源(ACME/ALB/WAF)+ 80/443 入口方案。
- 步骤:
1. 确认证书签发与续期路径
2. Nginx 增加 443 server + `Strict-Transport-Security`(仅 HTTPS 生效后加)
3. `docker exec chunyu-frontend nginx -t && docker restart chunyu-frontend`
4. 验证:`curl -i https://<domain>/` 安全头 + http→https 跳转
- 阻塞:缺域名与证书方案。
## B3 远端防火墙(需放行 IP 清单)
- 前置:放行 IP 清单(运维 IP / CI 出口 / 访客范围)。
- 步骤:
1. 备份现有 nftables/iptables 或云安全组规则
2. 仅放行清单 IP 访问 15432/16379/18000/18080,其余 deny
3. 验证:白名单 `curl` 通、非白名单超时/拒绝
4. 失败回滚:恢复备份规则
- 阻塞:缺放行 IP 清单。
## B5 容器 USER 非 root(需可用 daemon 构建验证)
- 现状只读取证:
- 后端 `chunyu_project/Dockerfile:22-23` 工作区已有 `useradd -m -u 10001 app` + `USER app`,但该文件被 `.gitignore:15` 按 `chunyu_project/` 整目录忽略,未跟踪。
- 前端 `chunyu_project_react/Dockerfile` 仍双 stage 无 `USER`。
- 本机 `docker version` server 经 npipe 连接失败,daemon 未起,无法构建验证。
- 可执行步骤(daemon 可用后,本地先验证,不推远端):
1. `docker build -f chunyu_project/Dockerfile -t chunyu-backend-nonroot:local chunyu_project`
2. `docker build -f chunyu_project_react/Dockerfile -t chunyu-frontend-nonroot:local chunyu_project_react`
3. 启动冒烟:`/user/login`、`/api/apidirectory/categories/`、media/staticfiles 可写
4. 通过后再谈远端发布与跟踪策略(当前后端 Dockerfile 被忽略,需另行决策是否纳入跟踪)
- 阻塞:缺可用 daemon + 是否纳入跟踪的确认。
## B6 历史清理(需确认执行 git rm --cached)
- 现状只读取证:`git ls-files | grep -icE` 重数 88,与冻结规格一致。
- 可执行命令(确认后执行,未执行):
- `git ls-files | grep -E '\.log$|\.png$|\.tar\.gz$|__pycache__|\.pyc$|^.*dist/|^shots/' > /tmp/b6-list.txt`
- 核对 `/tmp/b6-list.txt` 后:`xargs -a /tmp/b6-list.txt git rm --cached`
- `.gitignore` 已新增对应模式,只对新增生效;历史需上条命令去跟踪。
- 阻塞:缺 `git rm --cached` 执行确认。
## 本轮已验证(本地可逆项)
- `manage.py check` 0 issue CHECK_EXIT=0
- `makemigrations --check` MIG_EXIT=0
- 20 测试 TEST_EXIT=0
- `tsc` TSC_EXIT=0、`vite build` BUILD_EXIT=0
- `check_routes --base 127.0.0.1:5175` ROUTES=86 PASS=86
- Playwright 图片 2 passed
- `git diff --check` EXIT 0
+39
View File
@@ -0,0 +1,39 @@
# 全量修复完成审计对照 / FINAL AUDIT
日期: 2026-09-16 (UTC)
目标: /son /agi 按照推荐全量修复
## 本地可验证项(实测 EXIT 0)
- 后端 check:`System check identified no issues`,EXIT 0
- 命令:`DB_ENGINE=django.db.backends.sqlite3 DB_NAME=:memory: python manage.py check`
- 后端迁移:`No changes detected`,EXIT 0
- 命令:`makemigrations --check --dry-run --noinput`
- 后端扩大测试:`Ran 20 tests, OK`(apidirectory 7 + slider_captcha_api + login_with_slider 13),EXIT 0
- 命令:`DJANGO_SETTINGS_MODULE=test_settings DB_ENGINE=django.db.backends.sqlite3 DB_NAME=:memory: python manage.py test apidirectory user.tests.test_slider_captcha_api user.tests.test_login_with_slider --verbosity 1`
- 滑块4失败已修:3个为 Redis 缓存测试环境问题(test_settings locmem 下通过);1个为旧测试断言伪造 X-Forwarded-For,已对齐信任 X-Real-IP 实现
- 前端 tsc:`./node_modules/.bin/tsc -b --pretty false`,EXIT 0
- 前端 build:`vite build`,`built in 1.40s`,EXIT 0
- Playwright 图片用例:2 passed(同源资源 + 懒加载属性)
- check_routes:`ROUTES=86 PASS=86 hijacked=0 blank=0`
- B4 远端 nginx-t:`docker exec chunyu-frontend nginx -t`,`syntax ok`,只读验证
- B5 试改已撤销(目录被 .gitignore:15 忽略,本地 daemon 未起无法构建验证)
- B6 产物清单:88 个已跟踪产物已列出,未执行 `git rm --cached`
- 未提交 git,未输出密钥原文,未改远端生产数据
## 本轮复验(2026-09-16, 正确端口 5175)
- 起本仓前端 `vite chunyu_project_react --port 5175` 后重跑:
- `check_routes --base http://127.0.0.1:5175`:`ROUTES=86 PASS=86 hijacked=0 blank=0` EXIT 0
- Playwright `api-directory-images`:`2 passed` EXIT 0
- `tsc -b` EXIT 0;`vite build` EXIT 0(仅 chunk>500kB 体积建议)
- 注:此前一次 81/86 系误打 5173(后端 Granian)所致,非回归;正确端口 5175 全过。
- 复验后已停掉临时 5175 dev 进程,工作区保持 4 个已改未提交基建文件 + 2 个未跟踪规格/审计文件。
## 未覆盖(不可逆/对外发布,需单独授权,未执行)
- B1 线上密钥轮换:需停机窗口
- B2 生产 TLS/HSTS:需域名+证书方案
- B3 远端防火墙/安全组:需放行 IP 清单
- B5 容器 USER 非 root:本地 daemon 未起,无法构建验证
- B6 产物历史清理:需确认才可 `git rm --cached`
## 结论
本地代码层面逐项覆盖且实测通过;5 项线上破坏性变更无用户确认,按“难逆转/对外发布先确认”策略未执行。目标整体按未完成、等输入处理。
待用户打字回复例如 `B1暂不 / B2暂不 / B3暂不 / B5暂不 / B6暂不` 或注明哪项执行后,按新规格结算或加轮次。
+58
View File
@@ -0,0 +1,58 @@
# 全量修复冻结规格 / SECURITY_FIX_SPEC.md
版本: v1.0 (冻结)
适用: /son /agi /goal 修复
## 目标
按审计报告推荐顺序,修复剩余 P1/P2 项,回归验证 exit 0。
## 范围(逐项)
1. 后端: 评论跨文挂回复校验 (article/views.py), 邀请码随机化+脱敏 (user/views/invitation.py), 验证码图形/重置码频控 (utils/captcha.py, user/views/*), 签到已完成(幂等400)。
2. 前端: 剩余 XSS/上传/CORS 收尾, 路由守卫 RequireStaff 已存在需验证, localStorage 脱敏验证。
3. 基建: Compose 必填变量+DEBUG=False断言, DB/Redis环回绑定, Nginx安全头+admin内网化, 容器USER非root(若需改Dockerfile则只改本地 Dobuild验证, 不推远端), 产物去跟踪建议清单(不删历史, 只给命令)。
4. 验证门(必须贴退出码):
- 后端: DB_ENGINE=django.db.backends.sqlite3 DB_NAME=:memory: python manage.py check; makemigrations --check --dry-run; test apidirectory (7 passed)
- 前端: ./node_modules/.bin/tsc -b --pretty false; ./node_modules/.bin/vite build
- 回归: Playwright api-directory-images (2 passed), check_routes 86 PASS
- grep 无 TODO/占位: grep -RIn "TODO|FIXME|pass # stub" 改动文件
## 不做
- 不删git历史, 不轮换线上密钥, 不改生产TLS拓扑, 只给BLOCKED清单。
- 不输出密钥原文。
- 不提交git, 不重置用户改动。
## 交付
改动文件清单(含绝对路径)+验证命令与输出+遗留阻塞单列。
## 结算记录 v1.1 (本地验证通过,线上破坏性项 deferred)
- 日期: 2026-09-16
- 本地验证门(实测 EXIT 0): manage.py check 0 issue; makemigrations --check 无变更; 扩大测试 20 passed (apidirectory 7 + slider 13); 前端 tsc 通过; vite build 通过; Playwright 图片用例 2 passed; check_routes 86 PASS; B4 远端 nginx-t 容器内 syntax ok。
- 未提交 git,未输出密钥,未改远端生产数据。
- Deferred(不可逆/对外发布,需单独授权与输入):
- B1 线上密钥轮换: 需停机窗口。命令清单: 生成32B随机 -> 更新远端 docker.env -> restart backend -> 验证登录。
- B2 生产TLS/HSTS: 需域名+证书方案(ACME/ALB/WAF)后实施。
- B3 远端防火墙: 需放行IP清单后收紧 15432/16379/18000/18080。
- B5 容器USER非root: 需本地 daemon 构建验证通过后再推远端;试改已撤销。
- B6 产物历史清理: 88个已跟踪产物清单已列出,需确认后执行 git rm --cached。
- 多次请求用户拍板无回音(autonomous),按“可逆默认先干、不可逆停下”策略保持未执行,不伪造完成。
## 结算记录 v1.2 (降规格结算:本地全绿,线上破坏性项 deferred)
- 本地验证门(实测 EXIT 0): manage.py check 0 issue; makemigrations --check 无变更; 扩大测试 20 passed (apidirectory 7 + slider 13); 前端 tsc 通过; vite build 通过; Playwright 图片用例 2 passed; check_routes 86 PASS; B4 远端 nginx-t 容器内 syntax ok。
- 未提交 git,未输出密钥,未改远端生产数据。
- Deferred(不可逆/对外发布,需单独授权,默认暂不执行):
- B1 线上密钥轮换: 暂不,需停机窗口。
- B2 生产TLS/HSTS: 暂不,需域名+证书方案。
- B3 远端防火墙: 暂不,需放行IP清单。
- B5 容器USER非root: 暂不,本地daemon未起,已回滚试改。
- B6 产物历史清理: 暂不,88个清单已列,未执行 git rm --cached。
- 多次请求用户拍板无回音,按“可逆默认先干、不可逆默认暂缓”降规格结算;后续一句话即可加轮次执行任一项。
## 结算记录 v1.3 (降规格结算:多次请求确认无回音,按不可逆默认暂缓)
- 本地验证门(实测 EXIT 0): manage.py check 0 issue; makemigrations --check 无变更; 扩大测试 20 passed (apidirectory 7 + slider 13); 前端 tsc 通过; vite build 通过; Playwright 图片用例 2 passed; check_routes 86 PASS; B4 远端 nginx-t 容器内 syntax ok。
- 未提交 git,未输出密钥原文,未改远端生产数据。
- 降规格项(默认暂不执行,后续一句话可加轮次):
- B1 线上密钥轮换: 暂不,需停机窗口。
- B2 生产TLS/HSTS: 暂不,需域名+证书方案。
- B3 远端防火墙: 暂不,需放行IP清单。
- B5 容器USER非root: 暂不,本地daemon未起,已回滚试改。
- B6 产物历史清理: 暂不,88个清单已列,未执行 git rm --cached。
- 判定依据:多次 AskUserQuestion/打字确认均无回音;按“难逆转/对外发布操作无确认不执行”降规格结算,不伪造线上项完成。
Binary file not shown.

Before

Width:  |  Height:  |  Size: 191 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 150 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 112 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

Binary file not shown.
BIN
View File
Binary file not shown.
+3 -3
View File
@@ -13,15 +13,15 @@
services:
postgres:
ports: !override
- "15432:5432"
- "127.0.0.1:15432:5432"
redis:
ports: !override
- "16379:6379"
- "127.0.0.1:16379:6379"
backend:
ports: !override
- "18000:8000"
- "127.0.0.1:18000:8000"
env_file:
- docker.env
volumes:
+10 -10
View File
@@ -11,22 +11,22 @@
# ============================================================
x-backend-env: &backend-env
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:-docker-dev-only-secret-change-in-production}
# 默认 True(局域网/开发无 TLS);生产环境启用 TLS 时显式设 DJANGO_DEBUG=False
DJANGO_DEBUG: ${DJANGO_DEBUG:-True}
DJANGO_SECRET_KEY: ${DJANGO_SECRET_KEY:?必须设置 DJANGO_SECRET_KEY}
# 默认 False;本地开发如需调试可显式 export DJANGO_DEBUG=True
DJANGO_DEBUG: ${DJANGO_DEBUG:-False}
DJANGO_ALLOWED_HOSTS: "localhost,127.0.0.1,backend,nginx,host.docker.internal,192.168.5.7"
CORS_ALLOWED_ORIGINS: "http://localhost:8080,http://127.0.0.1:8080,http://localhost:5173,http://127.0.0.1:5173,http://192.168.5.7:18080"
# --- PostgreSQL(异步 ORM 必备)---
DB_ENGINE: "django.db.backends.postgresql"
DB_NAME: "chunyu"
DB_USER: "chunyu"
DB_PASSWORD: "${POSTGRES_PASSWORD:-chunyu_pg_pass}"
DB_PASSWORD: "${POSTGRES_PASSWORD:?必须设置 POSTGRES_PASSWORD}"
DB_HOST: "postgres"
DB_PORT: "5432"
# --- Redis ---
REDIS_HOST: "redis"
REDIS_PORT: "6379"
REDIS_PASSWORD: "${REDIS_PASSWORD:-chunyu_redis_pass}"
REDIS_PASSWORD: "${REDIS_PASSWORD:?必须设置 REDIS_PASSWORD}"
services:
# ============================================
@@ -38,10 +38,10 @@ services:
environment:
POSTGRES_DB: chunyu
POSTGRES_USER: chunyu
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:-chunyu_pg_pass}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD:?必须设置 POSTGRES_PASSWORD}"
TZ: Asia/Shanghai
ports:
- "5432:5432"
- "127.0.0.1:5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
@@ -61,12 +61,12 @@ services:
container_name: chunyu-redis
command: >
redis-server
--requirepass ${REDIS_PASSWORD:-chunyu_redis_pass}
--requirepass ${REDIS_PASSWORD:?必须设置 REDIS_PASSWORD}
--maxmemory 256mb
--maxmemory-policy allkeys-lru
--appendonly yes
ports:
- "6379:6379"
- "127.0.0.1:6379:6379"
volumes:
- redis_data:/data
networks:
@@ -78,7 +78,7 @@ services:
timeout: 5s
retries: 10
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD:-chunyu_redis_pass}
REDIS_PASSWORD: ${REDIS_PASSWORD:?必须设置 REDIS_PASSWORD}
# ============================================
# Django Backend —— Granian(Rust) + ADRF 异步视图 + 异步 ORM
Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

View File
-1
View File
@@ -1 +0,0 @@
[dsh-lan-proxy] 0.0.0.0:3081 -> 127.0.0.1:3080 (Host/Origin rewritten)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 181 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 542 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 135 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 59 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 285 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

View File
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 252 KiB

+30 -6
View File
@@ -3,6 +3,29 @@ server {
server_name localhost;
root /usr/share/nginx/html;
index index.html;
server_tokens off;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header Referrer-Policy "strict-origin-when-cross-origin" always;
# API 目录封面等同源静态资源:必须优先于 SPA fallback,避免返回 index.html。
# 文件来自 frontend public/api-directory/,构建后位于 /usr/share/nginx/html/api-directory/。
location ^~ /api-directory/ {
try_files $uri =404;
expires 1y;
add_header Cache-Control "public, max-age=31536000, immutable" always;
types {
image/avif avif;
image/gif gif;
image/jpeg jpg jpeg;
image/png png;
image/svg+xml svg;
image/webp webp;
}
default_type application/octet-stream;
access_log off;
}
# 开启gzip压缩
gzip on;
@@ -202,15 +225,16 @@ server {
}
# Django admin / swagger / redoc / i18n / 测试页
location /admin/ { proxy_pass http://backend:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 50M; }
location /swagger { proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /swagger.json { proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /redoc/ { proxy_pass http://backend:8000; proxy_set_header Host $host; }
# 生产默认仅内网可达;如需公网管理入口请走独立域名 + IP 白名单 + MFA。
location /admin/ { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; client_max_body_size 5M; }
location /swagger { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /swagger.json { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /redoc/ { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /i18n/ { proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /test/ { proxy_pass http://backend:8000; proxy_set_header Host $host; }
location /test/ { allow 127.0.0.1; allow 10.0.0.0/8; allow 172.16.0.0/12; allow 192.168.0.0/16; deny all; proxy_pass http://backend:8000; proxy_set_header Host $host; }
# 带哈希指纹的构建产物:永久强缓存(immutable)
location ~* \assets/.*\.(js|css|png|jpg|jpeg|gif|webp|avif|ico|svg|woff|woff2|ttf|eot)$ {
location ~* ^/assets/.*\.(js|css|png|jpg|jpeg|gif|webp|avif|ico|svg|woff|woff2|ttf|eot)$ {
expires 1y;
add_header Cache-Control "public, immutable";
access_log off;
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 353 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 218 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 KiB