[GH-ISSUE #942] 无法将两个域名同时设置为subdomain_host #750

Closed
opened 2026-05-05 12:28:47 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @pureair on GitHub (Oct 10, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/942

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)

Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST

What version of frp are you using (./frpc -v or ./frps -v)?
Frps version 0.20.0

What operating system and processor architecture are you using (go env)?
Debian 8, x64

Configures you used:

[common] is integral section
[common]
# A literal address or host name for IPv6 must be enclosed
# in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80"
bind_addr = [::]
bind_port = 4***
# udp port used for kcp protocol, it can be same with 'bind_port'
# if not set, kcp is disabled in frps
kcp_bind_port = 4***
# if you want to configure or reload frps by dashboard, dashboard_port must be set
dashboard_port = 9***
# dashboard assets directory(only for debug mode)
dashboard_user = j****
dashboard_pwd = K******
# assets_dir = ./static
vhost_http_port = 80
vhost_https_port = 443
# console or real lo6gFile path like ./frps.log
log_file = /dev/null
# debug, info, warn, error
log_level = info
log_max_days = 3
# auth token
token = X*******
# only allow frpc to bind ports you list, if you set nothing, there won't be any limit
#allow_ports = 1-65535
# pool_count in each proxy will change to max_pool_count if they exceed the maximum value
max_pool_count = 30
# if tcp stream multiplexing is used, default is true
tcp_mux = tru
# set hostname for subdomain 
subdomain_host = mydomain.com, mydomian.net

Steps to reproduce the issue:

  1. set "subdomain_host = mydomain.net", service.mydomain.net is accessible.
  2. set "subdomain_host = mydomain.com, mydomian.net", neither service.mydomain.com nor service.mydomain.net is not accessible. frp server returned "The page you visit not found."

Describe the results you received:
frps does not undertand there are two domains.

Describe the results you expected:
frps undertands there are two domains. Both service.mydomain.com and service.mydomain.net are accessible and point to the same service.

Additional information you deem important (e.g. issue happens only occasionally):
I want to have two domains because I want to use CDN, but sometimes the CDN provider is inaccessible from mainland China, so I need to have a domain resolved directly to my server as a backup.

Can you point out what caused this issue (optional)
I'm not sure it's a bug or a feature request. I saw some one tried to config multiple domians #582 but he/she closed the issue himself and I guess he solved it somehow.

Originally created by @pureair on GitHub (Oct 10, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/942 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST **What version of frp are you using (./frpc -v or ./frps -v)?** Frps version 0.20.0 **What operating system and processor architecture are you using (`go env`)?** Debian 8, x64 **Configures you used:** ``` [common] is integral section [common] # A literal address or host name for IPv6 must be enclosed # in square brackets, as in "[::1]:80", "[ipv6-host]:http" or "[ipv6-host%zone]:80" bind_addr = [::] bind_port = 4*** # udp port used for kcp protocol, it can be same with 'bind_port' # if not set, kcp is disabled in frps kcp_bind_port = 4*** # if you want to configure or reload frps by dashboard, dashboard_port must be set dashboard_port = 9*** # dashboard assets directory(only for debug mode) dashboard_user = j**** dashboard_pwd = K****** # assets_dir = ./static vhost_http_port = 80 vhost_https_port = 443 # console or real lo6gFile path like ./frps.log log_file = /dev/null # debug, info, warn, error log_level = info log_max_days = 3 # auth token token = X******* # only allow frpc to bind ports you list, if you set nothing, there won't be any limit #allow_ports = 1-65535 # pool_count in each proxy will change to max_pool_count if they exceed the maximum value max_pool_count = 30 # if tcp stream multiplexing is used, default is true tcp_mux = tru # set hostname for subdomain subdomain_host = mydomain.com, mydomian.net ``` **Steps to reproduce the issue:** 1. set "subdomain_host = mydomain.net", service.mydomain.net is accessible. 2. set "subdomain_host = mydomain.com, mydomian.net", neither service.mydomain.com nor service.mydomain.net is not accessible. frp server returned "The page you visit not found." **Describe the results you received:** frps does not undertand there are two domains. **Describe the results you expected:** frps undertands there are two domains. Both service.mydomain.com and service.mydomain.net are accessible and point to the same service. **Additional information you deem important (e.g. issue happens only occasionally):** I want to have two domains because I want to use CDN, but sometimes the CDN provider is inaccessible from mainland China, so I need to have a domain resolved directly to my server as a backup. **Can you point out what caused this issue (optional)** I'm not sure it's a bug or a feature request. I saw some one tried to config multiple domians #582 but he/she closed the issue himself and I guess he solved it somehow.
Author
Owner

@fatedier commented on GitHub (Nov 21, 2018):

No plan to support that. You can use custom_domain instead.

<!-- gh-comment-id:440502674 --> @fatedier commented on GitHub (Nov 21, 2018): No plan to support that. You can use `custom_domain` instead.
Author
Owner

@walejandromt commented on GitHub (Jun 23, 2023):

i hope that add this feature

frp v0.46 no work and we can connect with chat.myhost.com and chat.domains.com

frps.ini

[common]
subdomain_host = myhost.com,domains.com

frpc.ini

[chat-web-http]
type = http
local_ip = {{ .Envs.HTTP_LOCAL_IP }}
local_port = {{ .Envs.HTTP_LOCAL_PORT }}
subdomain = chat

[www-web-http]
type = http
local_ip = {{ .Envs.HTTP_LOCAL_IP }}
local_port = {{ .Envs.HTTP_LOCAL_PORT }}
subdomain = www

[jenkins-web-http]
type = http
local_ip = {{ .Envs.HTTP_LOCAL_IP }}
local_port = {{ .Envs.HTTP_LOCAL_PORT }}
subdomain = jenkins
<!-- gh-comment-id:1604347147 --> @walejandromt commented on GitHub (Jun 23, 2023): i hope that add this feature frp v0.46 no work and we can connect with chat.myhost.com and chat.domains.com frps.ini ```xml [common] subdomain_host = myhost.com,domains.com ``` frpc.ini ```xml [chat-web-http] type = http local_ip = {{ .Envs.HTTP_LOCAL_IP }} local_port = {{ .Envs.HTTP_LOCAL_PORT }} subdomain = chat [www-web-http] type = http local_ip = {{ .Envs.HTTP_LOCAL_IP }} local_port = {{ .Envs.HTTP_LOCAL_PORT }} subdomain = www [jenkins-web-http] type = http local_ip = {{ .Envs.HTTP_LOCAL_IP }} local_port = {{ .Envs.HTTP_LOCAL_PORT }} subdomain = jenkins ```
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#750
No description provided.