Files
ipass-plugin-cache/conf/tls/README.md
T
ssw 43718bd0c4 iPass cache gateway 源码
容量管理: zones.rs 直读 nginx file_cache 共享内存记账(双轴: 磁盘 + keys_zone 索引内存), ?scan=1 扫盘上限 20 万文件; POST /api/admin/cache/purge 整区清理(只删文件不删目录, 根治 [crit] mkdir failed); POST /api/admin/cache/invalidate 按制品精准失效(预览->确认两步式, glob/子串, 删除上限 5000/扫描上限 20 万); GET /api/admin/cache 新增 capacity 块; 前端容量面板 + 按制品失效工具条; 测试 test-cache-capacity.sh 48/48(容量 27 + 精准失效 21, 含 EXPECT_MIN 护栏与前端静态契约); docs 容量管理章节
2026-09-21 09:25:11 +08:00

43 lines
1.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# conf/tls/ —— TLS 入口
`conf/nginx.cache.conf` 的 `http` 块里有:
```nginx
include /usr/local/nginx/conf/tls/*.conf;
```
目录为空时 include 无匹配,nginx 照常启动。往里放任意 `*.conf`(每个文件是
一个完整的 `server { ... }` 块)即启用该域名的 HTTPS。
| 文件 | 作用 |
| --- | --- |
| `cache.conf.example` | TLS 入口模板。`cp` 成 `cache.conf` 后改域名/证书路径即生效 |
## 为什么制品缓存必须有 TLS 入口
* **Docker**:`registry-mirrors` 只接受 https。明文地址会被 daemon 拒绝
(除非把主机加进 `insecure-registries`,那等于放弃传输安全)。
* **`pip` / `npm` / `cargo`**:都支持 `https://user:pass@host/` 或 token 形式,
但明文 http 会让凭据裸奔——网关的下行 `sk_` 是长期凭据,不该走明文。
## 证书放哪
按域名建目录(可以带字面 `*`,ipass 生产就是这么存无级别泛域名证书的):
```
conf/tls/cache.example.com/
├── fullchain.cer
├── cache.example.com.key
└── ca.cer
```
## 注意
* `*.example` 后缀不会被 `include *.conf;` 匹配到,所以模板文件放在这里**不会**
被误加载。
* 本项目的 nginx 必须带 `--with-http_ssl_module`(`build/build-nginx-ssl.sh`
已包含)。用早前那个 `--without-http_rewrite_module` 的裁剪版会直接
报 `unknown directive "ssl_certificate"`。
* `conf/tls/*.conf` 与 `server.cache.conf` 里的明文入口**共用**同一份
`cache-routes.conf`,因此路由、鉴权、探针、管理台只维护一份。