Nginx Proxy Manager Workflow
Use this skill to terminate SSL at NPM and route traffic to backend services (staging/prod).
Required inputs
- - Domain/subdomain (e.g.
staging.example.com) - Public DNS already pointing to NPM public IP
- Upstream target host/IP + port (e.g.
10.10.10.227:3000) - Whether Cloudflare proxy is enabled (if used)
Authentication (do not hardcode secrets)
Store credentials outside this skill (local secret file or environment variables).
Recommended env vars:
- -
NPM_BASE_URL (e.g. http://<npm-host>:81) - INLINECODE4
- INLINECODE5
Example token request:
CODEBLOCK0
Standard setup flow
- 1. Confirm DNS resolves to NPM public IP.
- Create or update Proxy Host in NPM:
- Domain Names: requested host(s)
- Scheme:
http (or
https if upstream is TLS)
- Forward Hostname/IP: upstream IP/hostname
- Forward Port: app port
- Enable:
- Block Common Exploits
- Websockets Support
- 3. SSL tab:
- Request new SSL certificate (Let's Encrypt)
- Enable
Force SSL
- Enable
HTTP/2 Support
- Enable
HSTS only after validation
- 4. Save and verify:
-
curl -I https://<domain> returns
200/301
- Browser check for valid certificate and app reachability
Recommended defaults
- - Keep upstream as private IP where possible.
- Use separate hostnames per environment:
-
app.example.com → production
-
staging.example.com → staging
- - Avoid wildcard certificates unless explicitly needed.
Troubleshooting
- - Certificate issuance fails:
- Check DNS A/AAAA records
- Ensure ports 80/443 reach NPM
- Disable conflicting CDN TLS mode or set to Full/Strict appropriately
- Verify upstream container/service is running
- Verify correct target port and local firewall rules
- Don’t double-force HTTPS (app + proxy misconfiguration)
Publication hygiene checklist
Before sharing/publishing this skill:
- - Remove all real IPs, domains, emails, and tokens.
- Keep only placeholders like
example.com and <npm-host>. - Ensure no local credential file paths or secret values are included.
Safety rules
- - Never remove existing production proxy hosts unless explicitly requested.
- For changes on production domains, snapshot/export config or document previous values first.
- Apply changes to staging first when possible.
Nginx Proxy Manager 工作流程
使用此技能在NPM终止SSL并将流量路由到后端服务(预发布/生产环境)。
必需输入
- - 域名/子域名(例如 staging.example.com)
- 公共DNS已指向NPM公网IP
- 上游目标主机/IP + 端口(例如 10.10.10.227:3000)
- 是否启用Cloudflare代理(如使用)
身份验证(请勿硬编码密钥)
将凭据存储在此技能之外(本地密钥文件或环境变量)。
推荐的环境变量:
- - NPMBASEURL(例如 http://:81)
- NPMIDENTITY
- NPMSECRET
令牌请求示例:
bash
curl -sS -X POST $NPMBASEURL/api/tokens \
-H Content-Type: application/json; charset=UTF-8 \
--data {\identity\:\$NPMIDENTITY\,\secret\:\$NPMSECRET\}
标准设置流程
- 1. 确认DNS已解析到NPM公网IP。
- 在NPM中创建或更新代理主机:
- 域名:请求的主机名
- 协议:http(如果上游使用TLS则为https)
- 转发主机名/IP:上游IP/主机名
- 转发端口:应用端口
- 启用:
- 阻止常见漏洞攻击
- WebSocket支持
- 3. SSL标签页:
- 申请新的SSL证书(Lets Encrypt)
- 启用强制SSL
- 启用HTTP/2支持
- 验证后启用HSTS
- 4. 保存并验证:
- curl -I https://<域名> 返回 200/301
- 浏览器检查证书有效性和应用可达性
推荐默认设置
- - 尽可能将上游保持为私有IP。
- 为每个环境使用独立主机名:
- app.example.com → 生产环境
- staging.example.com → 预发布环境
故障排除
- 检查DNS A/AAAA记录
- 确保80/443端口可达NPM
- 禁用冲突的CDN TLS模式,或适当设置为完全/严格模式
- 验证上游容器/服务是否运行
- 验证目标端口和本地防火墙规则是否正确
- 不要双重强制HTTPS(应用与代理配置冲突)
发布卫生检查清单
在分享/发布此技能前:
- - 移除所有真实IP、域名、邮箱和令牌。
- 仅保留占位符如 example.com 和 。
- 确保不包含任何本地凭据文件路径或密钥值。
安全规则
- - 除非明确要求,否则切勿删除现有生产环境的代理主机。
- 对生产域名进行更改前,先快照/导出配置或记录原值。
- 尽可能先在预发布环境应用更改。