[GH-ISSUE #3359] 如何实现绑定多个域名 #2687

Closed
opened 2026-05-05 13:43:56 -06:00 by gitea-mirror · 6 comments
Owner

Originally created by @kingchaoliang on GitHub (Mar 14, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3359

Describe the feature request

功能需求:我在甲骨文做了frp,然后穿透到自己的nas服务器。然后nas服务器里面绑定了多个网站

问题了解:
1.目前用很愚蠢的方法就是甲骨文单独建立多个网站配置对应的frp设置
2.我需要用到ssl,目前需要申请了证书后再甲骨文的配置里面填上证书且在nas的对应网站也要填写上证书。

有没有比较好的办法方便配置以实现我直接在nas的宝塔直接配置好。

Describe alternatives you've considered

No response

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @kingchaoliang on GitHub (Mar 14, 2023). Original GitHub issue: https://github.com/fatedier/frp/issues/3359 ### Describe the feature request 功能需求:我在甲骨文做了frp,然后穿透到自己的nas服务器。然后nas服务器里面绑定了多个网站 问题了解: 1.目前用很愚蠢的方法就是甲骨文单独建立多个网站配置对应的frp设置 2.我需要用到ssl,目前需要申请了证书后再甲骨文的配置里面填上证书且在nas的对应网站也要填写上证书。 有没有比较好的办法方便配置以实现我直接在nas的宝塔直接配置好。 ### Describe alternatives you've considered _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [X] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:43:56 -06:00
Author
Owner

@visualwind commented on GitHub (Mar 14, 2023):

port to port,然后caddy反代

<!-- gh-comment-id:1467763555 --> @visualwind commented on GitHub (Mar 14, 2023): port to port,然后caddy反代
Author
Owner

@Becods commented on GitHub (Mar 14, 2023):

#Accessing Internal Web Services with Custom Domains in LAN

<!-- gh-comment-id:1468265720 --> @Becods commented on GitHub (Mar 14, 2023): [#Accessing Internal Web Services with Custom Domains in LAN](https://github.com/fatedier/frp#accessing-internal-web-services-with-custom-domains-in-lan)
Author
Owner

@vpei commented on GitHub (Mar 28, 2023):

在NAS安装FRPC,设置好不同域名指定到不同端口,需要使用https,把证书的位置配置一下。

<!-- gh-comment-id:1486142085 --> @vpei commented on GitHub (Mar 28, 2023): 在NAS安装FRPC,设置好不同域名指定到不同端口,需要使用https,把证书的位置配置一下。
Author
Owner

@litrycn commented on GitHub (Apr 7, 2023):

frp支持通配符配置 https证书

frps配置:

[common]
bind_port = 80
vhost_http_port = 80
vhost_https_port = 443

服务端frpc1配置:

[common]
protocol = tcp
server_addr = 127.0.0.1
server_port = 80

[S*]
type = https
custom_domains = *.996.icu,*.fuck.996.icu
plugin = https2http
plugin_local_addr = 127.0.0.1:80
plugin_crt_path = /root/cert/996.icu_ecc/fullchain.cer
plugin_key_path = /root/cert/996.icu_ecc/996.icu.key
plugin_header_safe = https

其他环境frpc2配置

[common]
protocol = tcp
server_addr = 9.9.6.74
server_port = 80

[homeassistant]
type = http
local_ip = 192.168.0.1
local_port = 80
custom_domains = homeassistant.996.icu,homeassistant.fuck.996.icu

homeassistant.996.icu支持https访问: https://homeassistant.996.icu

访问时路由貌似是 frps >> frpc1 >> frpc2

<!-- gh-comment-id:1499872661 --> @litrycn commented on GitHub (Apr 7, 2023): frp支持通配符配置 https证书 frps配置: ``` [common] bind_port = 80 vhost_http_port = 80 vhost_https_port = 443 ``` 服务端frpc1配置: ``` [common] protocol = tcp server_addr = 127.0.0.1 server_port = 80 [S*] type = https custom_domains = *.996.icu,*.fuck.996.icu plugin = https2http plugin_local_addr = 127.0.0.1:80 plugin_crt_path = /root/cert/996.icu_ecc/fullchain.cer plugin_key_path = /root/cert/996.icu_ecc/996.icu.key plugin_header_safe = https ``` 其他环境frpc2配置 ``` [common] protocol = tcp server_addr = 9.9.6.74 server_port = 80 [homeassistant] type = http local_ip = 192.168.0.1 local_port = 80 custom_domains = homeassistant.996.icu,homeassistant.fuck.996.icu ``` homeassistant.996.icu支持https访问: https://homeassistant.996.icu 访问时路由貌似是 frps >> frpc1 >> frpc2
Author
Owner

@vpei commented on GitHub (Apr 14, 2023):

把所有域名都解析到frps的服务器,客户端使用https2http插件配置相应域名和证书即可。

[www_domain_com_https]
type = https
custom_domains = www.domain.com

plugin = https2http
plugin_local_addr = 127.0.0.1:80

# HTTPS 证书相关的配置
plugin_crt_path = /etc/frp/domain.com.crt
plugin_key_path = /etc/frp/domain.com.key
plugin_host_header_rewrite = 127.0.0.1
plugin_header_X-From-Where = frp
<!-- gh-comment-id:1507882197 --> @vpei commented on GitHub (Apr 14, 2023): 把所有域名都解析到frps的服务器,客户端使用https2http插件配置相应域名和证书即可。 ``` [www_domain_com_https] type = https custom_domains = www.domain.com plugin = https2http plugin_local_addr = 127.0.0.1:80 # HTTPS 证书相关的配置 plugin_crt_path = /etc/frp/domain.com.crt plugin_key_path = /etc/frp/domain.com.key plugin_host_header_rewrite = 127.0.0.1 plugin_header_X-From-Where = frp ```
Author
Owner

@github-actions[bot] commented on GitHub (May 15, 2023):

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

<!-- gh-comment-id:1547047999 --> @github-actions[bot] commented on GitHub (May 15, 2023): Issues go stale after 30d of inactivity. Stale issues rot after an additional 7d of inactivity and eventually close.
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#2687
No description provided.