[GH-ISSUE #254] subdomain_host与custom_domains检测的bug #179

Closed
opened 2026-05-05 11:55:48 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @vc1 on GitHub (Feb 13, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/254

frps.ini

[common]
subdomain_host = frp.mydomain.com

[web01]
custom_domains = web-frp.mydomain.com

$ ./frps -c ./frps.ini
Parse conf error: proxy [http] custom domain should not belong to subdomain_host

web-frp.mydomain.com 与 frp.mydomain.com 属于不同二级域名,互不影响
运行的时候却报错

Originally created by @vc1 on GitHub (Feb 13, 2017). Original GitHub issue: https://github.com/fatedier/frp/issues/254 frps.ini ``` [common] subdomain_host = frp.mydomain.com [web01] custom_domains = web-frp.mydomain.com ``` $ ./frps -c ./frps.ini `Parse conf error: proxy [http] custom domain should not belong to subdomain_host` `web-frp`.mydomain.com 与 `frp`.mydomain.com 属于不同二级域名,互不影响 运行的时候却报错
gitea-mirror 2026-05-05 11:55:48 -06:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@vc1 commented on GitHub (Feb 13, 2017):

文档里写到

只需要将 *.subdomain_host 解析到 frps 所在服务器。之后用户可以通过 subdomain 自行指定自己的 web 服务所需要使用的二级域名,通过 {subdomain}.{subdomain_host} 来访问自己的 web 服务。

客户端是必须启用 privilege_mode = true 才能配置subdomain吗??
设置特权模式后又必须指定一个remote_host,
我只是想不同客户端可以选择不同的子域名而已


已解决,原来要加上type,我以为配置块名字和服务端一样,缺省的字段就采用服务器端的...

[common]
server_addr = xxx
server_port = 7000
privilege_token = xxx

[https]
privilege_mode = true
type = https
subdomain = debug
local_ip = 127.0.0.1
local_port = 443
<!-- gh-comment-id:279363276 --> @vc1 commented on GitHub (Feb 13, 2017): 文档里写到 只需要将 *.subdomain_host 解析到 frps 所在服务器。之后用户可以通过 subdomain 自行指定自己的 web 服务所需要使用的二级域名,通过 {subdomain}.{subdomain_host} 来访问自己的 web 服务。 客户端是必须启用 `privilege_mode = true` 才能配置subdomain吗?? 设置特权模式后又必须指定一个remote_host, 我只是想不同客户端可以选择不同的子域名而已 --- 已解决,原来要加上type,我以为配置块名字和服务端一样,缺省的字段就采用服务器端的... ``` [common] server_addr = xxx server_port = 7000 privilege_token = xxx [https] privilege_mode = true type = https subdomain = debug local_ip = 127.0.0.1 local_port = 443 ```
Author
Owner

@vc1 commented on GitHub (Feb 13, 2017):

服务端配置了custom_domains

客户端

[https]
subdomain = debug
local_ip = 127.0.0.1
local_port = 443

这样运行以后,服务端配置了custom_domains和{subdomain}.{subdomain_host} 都可以访问到,
客户端没有配置subdomain,就使用服务器配置的subdomain,都没配置就由服务器随机生成一个,返回给客户端,这样比较省事

可以参考一下https://natapp.cn/

另外建议一下可以以命令行形式传入配置参数运行

<!-- gh-comment-id:279365083 --> @vc1 commented on GitHub (Feb 13, 2017): 服务端配置了custom_domains 客户端 ``` [https] subdomain = debug local_ip = 127.0.0.1 local_port = 443 ``` 这样运行以后,服务端配置了custom_domains和{subdomain}.{subdomain_host} 都可以访问到, 客户端没有配置subdomain,就使用服务器配置的subdomain,都没配置就由服务器随机生成一个,返回给客户端,这样比较省事 可以参考一下https://natapp.cn/ 另外建议一下可以以命令行形式传入配置参数运行
Author
Owner

@fatedier commented on GitHub (Feb 14, 2017):

你的提的第一个问题确实是一个 bug,web-frp.mydomain.com 应该是允许配置的,而 web.frp.mydomain.com 则不允许配置。

<!-- gh-comment-id:279766021 --> @fatedier commented on GitHub (Feb 14, 2017): 你的提的第一个问题确实是一个 bug,web-frp.mydomain.com 应该是允许配置的,而 web.frp.mydomain.com 则不允许配置。
Author
Owner

@fengqi commented on GitHub (Mar 8, 2017):

@fatedier
就算服务端启用了域名, 比如
[common]
subdomain_host = mydomain.com

客户端也支持
custom_domains = abc.mydomain.com

意思是 custom_domains = abc.mydomain.com 和 subdomain = abc 可以一起用
这样能兼容老配置

这样可以么

<!-- gh-comment-id:284926816 --> @fengqi commented on GitHub (Mar 8, 2017): @fatedier 就算服务端启用了域名, 比如 [common] subdomain_host = mydomain.com 客户端也支持 custom_domains = abc.mydomain.com 意思是 custom_domains = abc.mydomain.com 和 subdomain = abc 可以一起用 这样能兼容老配置 这样可以么
Author
Owner

@fatedier commented on GitHub (Mar 8, 2017):

如果最终域名一样,会报错,不一样的话可以兼容。

<!-- gh-comment-id:284937406 --> @fatedier commented on GitHub (Mar 8, 2017): 如果最终域名一样,会报错,不一样的话可以兼容。
Author
Owner

@fengqi commented on GitHub (Mar 8, 2017):

嗯, 说的是一样的情况

<!-- gh-comment-id:284937518 --> @fengqi commented on GitHub (Mar 8, 2017): 嗯, 说的是一样的情况
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#179
No description provided.