frp icon indicating copy to clipboard operation
frp copied to clipboard

[W] [control.go:168] [3f30cb330bc4eddb] [web-istoreos] start error: custom domain [i.frp.aaa.com] should not belong to subdomain host [frp.aaa.com]

Open blankhang opened this issue 1 year ago • 2 comments

Bug Description

以前的旧版本.ini 是可以这样配置3级域名 升级到toml 现在的版本 启动报错

frpc Version

0.54

frps Version

0.54

System Architecture

linux/amd64,

Configurations

frpc

serverAddr = "aaa"
serverPort = 7000


auth.method = "token"
# auth token
auth.token = "abcdef"

# connections will be established in advance, default value is zero
transport.poolCount = 5

# If tcp stream multiplexing is used, default is true, it must be same with frps
# transport.tcpMux = true

# Specify keep alive interval for tcp mux.
# only valid if tcpMux is enabled.
# transport.tcpMuxKeepaliveInterval = 60

# Communication protocol used to connect to server
# supports tcp, kcp, quic, websocket and wss now, default is tcp
transport.protocol = "tcp"

# set client binding ip when connect server, default is empty.
# only when protocol = tcp or websocket, the value will be used.
transport.connectServerLocalIP = "0.0.0.0"

# if you want to connect frps by http proxy or socks5 proxy or ntlm proxy, you can set proxyURL here or in global environment variables
# it only works when protocol is tcp
# transport.proxyURL = "http://user:[email protected]:8080"
# transport.proxyURL = "socks5://user:[email protected]:1080"
# transport.proxyURL = "ntlm://user:[email protected]:2080"

# quic protocol options
# transport.quic.keepalivePeriod = 10
# transport.quic.maxIdleTimeout = 30
# transport.quic.maxIncomingStreams = 100000

# If tls.enable is true, frpc will connect frps by tls.
# Since v0.50.0, the default value has been changed to true, and tls is enabled by default.
transport.tls.enable = true

# transport.tls.certFile = "client.crt"
# transport.tls.keyFile = "client.key"
# transport.tls.trustedCaFile = "ca.crt"
# transport.tls.serverName = "example.com"

# If the disableCustomTLSFirstByte is set to false, frpc will establish a connection with frps using the
# first custom byte when tls is enabled.
# Since v0.50.0, the default value has been changed to true, and the first custom byte is disabled by default.
# transport.tls.disableCustomTLSFirstByte = true

# Heartbeat configure, it's not recommended to modify the default value.
# The default value of heartbeatInterval is 10 and heartbeatTimeout is 90. Set negative value
# to disable it.
# transport.heartbeatInterval = 30
# transport.heartbeatTimeout = 90

# Specify a dns server, so frpc will use this instead of default one
# dnsServer = "8.8.8.8"

# Proxy names you want to start.
# Default is empty, means all proxies.
# start = ["ssh", "dns"]

# Specify udp packet size, unit is byte. If not set, the default value is 1500.
# This parameter should be same between client and server.
# It affects the udp and sudp proxy.
udpPacketSize = 1500


[[proxies]]
name = "ssl-local-17"
type = "tcp"
localIP = "192.168.50.17"
localPort = 22
remotePort = 12345


[[proxies]]
name = "rpd-local-2"
type = "tcp"
localIP = "192.168.50.2"
localPort = 3389
remotePort = 12346


[[proxies]]
name = "web-istoreos"
type = "http"
localIP = "192.168.50.17"
localPort = 80
subdomain = "i"
customDomains = ["i.frp.aaa.com"]


[[proxies]]
name = "web-lucky"
type = "http"
localIP = "192.168.50.17"
localPort = 16601
subdomain = "lucky"

frps

# This configuration file is for reference only. Please do not use this configuration directly to run the program as it may have various issues.

# 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"
# For single "bindAddr" field, no need square brackets, like `bindAddr = "::"`.
bindAddr = "0.0.0.0"
bindPort = 7000

# udp port used for kcp protocol, it can be same with 'bindPort'.
# if not set, kcp is disabled in frps.
kcpBindPort = 7000

# udp port used for quic protocol.
# if not set, quic is disabled in frps.
quicBindPort = 7001

# Specify which address proxy will listen for, default value is same with bindAddr
# proxyBindAddr = "127.0.0.1"

# quic protocol options
# transport.quic.keepalivePeriod = 10
# transport.quic.maxIdleTimeout = 30
# transport.quic.maxIncomingStreams = 100000

# Heartbeat configure, it's not recommended to modify the default value
# The default value of heartbeatTimeout is 90. Set negative value to disable it.
# transport.heartbeatTimeout = 90

# Pool count in each proxy will keep no more than maxPoolCount.
transport.maxPoolCount = 10

# If tcp stream multiplexing is used, default is true
transport.tcpMux = true

# Specify keep alive interval for tcp mux.
# only valid if tcpMux is true.
# transport.tcpMuxKeepaliveInterval = 60

# tcpKeepalive specifies the interval between keep-alive probes for an active network connection between frpc and frps.
# If negative, keep-alive probes are disabled.
# transport.tcpKeepalive = 7200

# transport.tls.force specifies whether to only accept TLS-encrypted connections. By default, the value is false.
transport.tls.force = false

# transport.tls.certFile = "server.crt"
# transport.tls.keyFile = "server.key"
# transport.tls.trustedCaFile = "ca.crt"

# If you want to support virtual host, you must set the http port for listening (optional)
# Note: http port and https port can be same with bindPort
vhostHTTPPort = 11101
vhostHTTPSPort = 11102

# Response header timeout(seconds) for vhost http server, default is 60s
# vhostHTTPTimeout = 60

# tcpmuxHTTPConnectPort specifies the port that the server listens for TCP
# HTTP CONNECT requests. If the value is 0, the server will not multiplex TCP
# requests on one single port. If it's not - it will listen on this value for
# HTTP CONNECT requests. By default, this value is 0.
# tcpmuxHTTPConnectPort = 1337

# If tcpmuxPassthrough is true, frps won't do any update on traffic.
# tcpmuxPassthrough = false

# Configure the web server to enable the dashboard for frps.
# dashboard is available only if webServer.port is set.
webServer.addr = "127.0.0.1"
webServer.port = 11001
webServer.user = "blankhang"
webServer.password = "63032569"
# webServer.tls.certFile = "server.crt"
# webServer.tls.keyFile = "server.key"
# dashboard assets directory(only for debug mode)
# webServer.assetsDir = "./static"

# Enable golang pprof handlers in dashboard listener.
# Dashboard port must be set first
webServer.pprofEnable = false

# enablePrometheus will export prometheus metrics on webServer in /metrics api.
enablePrometheus = true

# console or real logFile path like ./frps.log
log.to = "./frps.log"
# trace, debug, info, warn, error
log.level = "info"
log.maxDays = 3
# disable log colors when log.to is console, default is false
log.disablePrintColor = false

# DetailedErrorsToClient defines whether to send the specific error (with debug info) to frpc. By default, this value is true.
detailedErrorsToClient = true

# auth.method specifies what authentication method to use authenticate frpc with frps.
# If "token" is specified - token will be read into login message.
# If "oidc" is specified - OIDC (Open ID Connect) token will be issued using OIDC settings. By default, this value is "token".
auth.method = "token"

# auth.additionalScopes specifies additional scopes to include authentication information.
# Optional values are HeartBeats, NewWorkConns.
# auth.additionalScopes = ["HeartBeats", "NewWorkConns"]

# auth token
auth.token = "abcdef"

# oidc issuer specifies the issuer to verify OIDC tokens with.
auth.oidc.issuer = ""
# oidc audience specifies the audience OIDC tokens should contain when validated.
auth.oidc.audience = ""
# oidc skipExpiryCheck specifies whether to skip checking if the OIDC token is expired.
auth.oidc.skipExpiryCheck = false
# oidc skipIssuerCheck specifies whether to skip checking if the OIDC token's issuer claim matches the issuer specified in OidcIssuer.
auth.oidc.skipIssuerCheck = false



# If subDomainHost is not empty, you can set subdomain when type is http or https in frpc's configure file
# When subdomain is test, the host used by routing is test.frps.com
subDomainHost = "frp.mayangmedia.com"

# custom 404 page for HTTP requests
# custom404Page = "/path/to/404.html"

# specify udp packet size, unit is byte. If not set, the default value is 1500.
# This parameter should be same between client and server.
# It affects the udp and sudp proxy.
udpPacketSize = 1500

# Retention time for NAT hole punching strategy data.
natholeAnalysisDataReserveHours = 168

# ssh tunnel gateway
# If you want to enable this feature, the bindPort parameter is required, while others are optional.
# By default, this feature is disabled. It will be enabled if bindPort is greater than 0.
# sshTunnelGateway.bindPort = 2200
# sshTunnelGateway.privateKeyFile = "/home/frp-user/.ssh/id_rsa"
# sshTunnelGateway.autoGenPrivateKeyPath = ""
# sshTunnelGateway.authorizedKeysFile = "/home/frp-user/.ssh/authorized_keys"

#[[httpPlugins]]
#name = "user-manager"
#addr = "127.0.0.1:9000"
#path = "/handler"
#ops = ["Login"]

#[[httpPlugins]]
#name = "port-manager"
#addr = "127.0.0.1:9001"
#path = "/handler"

Logs

frpc  | 2024/02/11 03:43:47 [I] [root.go:142] start frpc service for config file [/etc/frp/frpc.toml]
frpc  | 2024/02/11 03:43:47 [I] [service.go:287] try to connect to server...
frpc  | 2024/02/11 03:43:47 [I] [service.go:279] [3f30cb330bc4eddb] login to server success, get run id [3f30cb330bc4eddb]
frpc  | 2024/02/11 03:43:47 [I] [proxy_manager.go:173] [3f30cb330bc4eddb] proxy added: [ssl-local-17 rpd-local-2 web-istoreos web-lucky]
frpc  | 2024/02/11 03:43:47 [I] [control.go:170] [3f30cb330bc4eddb] [rpd-local-2] start proxy success
frpc  | 2024/02/11 03:43:47 [I] [control.go:170] [3f30cb330bc4eddb] [ssl-local-17] start proxy success
frpc  | 2024/02/11 03:43:47 [W] [control.go:168] [3f30cb330bc4eddb] [web-istoreos] start error: custom domain [i.frp.aaa.com] should not belong to subdomain host [frp.aaa.com]
frpc  | 2024/02/11 03:43:47 [W] [control.go:168] [3f30cb330bc4eddb] [web-lucky] start error: custom domain [lucky.frp.aaa.com] should not belong to subdomain host [frp.aaa.com]

nginx frp

#
# istoreos to local 17
#
server {
        listen 80;
        server_name i.frp.aaa.com;
        return 301 https://$host$request_uri;
}

server {
        listen 443 ssl;
        server_name i.frp.aaa.com;
        
        # load ssl conf
        include /etc/nginx/ssl/options-ssl-nginx.conf;

        #local istoreos
        location /{
            proxy_pass http://127.0.0.1:11101;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $http_host;
            proxy_set_header X-NginX-Proxy true;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_max_temp_file_size 0;
            proxy_redirect off;
            proxy_read_timeout 240s;
        }
}

打开域名显示 i.frp.aaa.com/lucky.frp.aaa.com

The page you requested was not found.
Sorry, the page you are looking for is currently unavailable.
Please try again later.

The server is powered by [frp](https://github.com/fatedier/frp).

Faithfully yours, frp.

Steps to reproduce

... 使用如下配置,启动frps 无异常日志 启动frpc 有报错

Affected area

  • [ ] Docs
  • [ ] Installation
  • [ ] Performance and Scalability
  • [ ] Security
  • [ ] User Experience
  • [ ] Test and Release
  • [ ] Developer Infrastructure
  • [ ] Client Plugin
  • [ ] Server Plugin
  • [ ] Extensions
  • [ ] Others

blankhang avatar Feb 11 '24 03:02 blankhang

不知道哪里出了问题,麻烦帮忙看看

blankhang avatar Feb 11 '24 03:02 blankhang

而且发现在文档中功能特性->Http&Https->自定义二级域名 中服务端配置subdomainHost和参考->服务端配置中的subDomainHost大小写 不一致

eryunser avatar Feb 27 '24 00:02 eryunser

Issues go stale after 21d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.

github-actions[bot] avatar Mar 20 '24 00:03 github-actions[bot]