FRP 配置参数说明 (含自定义域名)
1. 全局配置段 [common]
| 参数 | 示例值 | 作用 |
|---|---|---|
| server_addr | 12.26.15.247 | FRP服务器地址 |
| server_port | 7000 | 服务器通信端口 |
| tcp_mux | true | 启用TCP多路复用 |
| protocol | tcp | 传输协议类型 |
| user | 1ba301ae951957 | 客户端身份标识 |
| token | 60d8a83c5e6168db | 鉴权令牌 |
| dns_server | 114.114.114.114 | DNS服务器地址 |
2. 代理配置段 [[proxies]]
| 参数 | 示例值 | 作用 |
|---|---|---|
| name | web | 代理规则名称 |
| type | http | 代理类型 (http/https) |
| local_ip | 127.0.0.1 | 本地服务IP |
| local_port | 8080 | 本地服务端口 |
| custom_domains | xdyl.club | 绑定的自定义域名 |
| use_encryption | true | 启用流量加密 |
| use_compression | true | 启用流量压缩 |
✅ 正确用法示例
[[proxies]]
name = "web_app"
type = "http" # 必须为 http/https 类型
local_ip = "127.0.0.1"
local_port = 3000
custom_domains = "xdyl.club"
use_encryption = true
⚠️ 注意事项
- 需在DNS服务商处将域名解析指向服务器IP
123.206.125.247 - 服务器端必须开启
vhost_http_port = 80或vhost_https_port = 443 - TCP/UDP代理不需要
custom_domains参数 - HTTPS需额外配置证书:
plugin_https_export_cert = true
3. 完整配置示例
HTTP 配置示例
[common]
server_addr = "123.206.125.247"
server_port = 7000
token = "60d8a83c544e6168db"
[[proxies]]
name = "web_service"
type = "http"
local_port = 8080
custom_domains = "xdyl.club"
HTTPS 配置示例
[[proxies]]
name = "https_service"
type = "https"
local_port = 8443
custom_domains = "xdyl.club"
plugin_https_export_cert = true # 自动生成证书(测试用)
# plugin_cert_path = "/path/to/cert.pem" # 正式证书路径
阅读全文
原文链接:https://xdyl.club/1454,转载请注明出处~~~
