devops: 边缘层加固——nginx limit_conn/UA 拦截/防盗链/下载限速 + jiu_redis 容器(todo #1/#2/#3)
nginx:店铺列表专属 2r/s zone、公开路径 limit_conn、抓取库/空 UA 403(OG 页 不拦空 UA 防误杀社交爬虫)、/images 防盗链(none 放行微信 webview)、 /downloads 限并发+限速。compose 新增 jiu_redis(64mb noeviction 无持久化, 仅回环);env 模板加 REDIS_ADDR。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,19 @@
|
||||
version: "3.9"
|
||||
services:
|
||||
# 限流/登录锁状态外置(后端 REDIS_ADDR=127.0.0.1:6379 时启用)。
|
||||
# 刻意无持久化(--save "" + appendonly no):状态丢了秒级重建,省小内存机的
|
||||
# fork/写盘开销;noeviction 防锁键被 LRU 逐出;仅绑回环无密码(同宿主
|
||||
# payd 容器经 bridge 网络够不着宿主回环),禁 CONFIG 命令兜底。
|
||||
jiu-redis:
|
||||
image: redis:7-alpine
|
||||
container_name: jiu_redis
|
||||
restart: always
|
||||
ports:
|
||||
- "127.0.0.1:6379:6379"
|
||||
command: >
|
||||
redis-server --maxmemory 64mb --maxmemory-policy noeviction
|
||||
--appendonly no --save "" --rename-command CONFIG ""
|
||||
|
||||
jiu-mysql:
|
||||
image: mysql:8.0
|
||||
container_name: jiu_mysql
|
||||
|
||||
Reference in New Issue
Block a user