网淘吧来吧,欢迎您!

Nginx Proxy Manager技能使用说明

2026-04-01 新闻来源:网淘吧 围观:18
电脑广告
手机广告

NPM 代理技能

通过其 REST API 管理 Nginx 代理管理器 (NPM)。

配置

设置以下环境变量:

Nginx Proxy Manager

  • NPM_URL:您的 NPM 实例的 URL(例如,https://npm.example.com
  • NPM_EMAIL:您的 NPM 管理员邮箱
  • NPM_PASSWORD:您的 NPM 管理员密码

使用

# List all proxy hosts
python scripts/npm_client.py hosts

# Get details for a specific host
python scripts/npm_client.py host <host_id>

# Enable/Disable a host
python scripts/npm_client.py enable <host_id>
python scripts/npm_client.py disable <host_id>

# Delete a host
python scripts/npm_client.py delete <host_id>

# List certificates
python scripts/npm_client.py certs

工作流程

添加新的代理主机

要添加新主机,请直接使用curl(当前脚本功能较为简单)。 针对POST /api/nginx/proxy-hosts的示例负载:

{
  "domain_names": ["sub.example.com"],
  "forward_scheme": "http",
  "forward_host": "192.168.1.10",
  "forward_port": 8080,
  "access_list_id": 0,
  "certificate_id": 0,
  "ssl_forced": false,
  "meta": {
    "letsencrypt_email": "",
    "letsencrypt_agree": false,
    "dns_challenge": false
  },
  "advanced_config": "",
  "locations": [],
  "block_exploits": true,
  "caching_enabled": false,
  "allow_websocket_upgrade": true,
  "http2_support": true,
  "hsts_enabled": false,
  "hsts_subdomains": false
}

启用 SSL (Let's Encrypt)

  1. 使用certs命令列出证书以查看是否存在。
  2. 更新主机,使用certificate_idssl_forced: true

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

文章底部电脑广告
手机广告位-内容正文底部

相关文章

您是本站第393720名访客 今日有1篇新文章/评论