[GH-ISSUE #2939] [Feature Request] 希望服务端能够配置通配符证书 #2344

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

Originally created by @xiaozhuai on GitHub (May 15, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/2939

Describe the feature request

为服务端的subdomain_host配置通配符域名证书
subdomain_hostfrps.xiaoming.com,则服务端可配置*.frps.xiaoming.com的证书
此时客户端在转发http时,可提供选项将http自动转为https。

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 @xiaozhuai on GitHub (May 15, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/2939 ### Describe the feature request 为服务端的`subdomain_host`配置通配符域名证书 如`subdomain_host`为`frps.xiaoming.com`,则服务端可配置`*.frps.xiaoming.com`的证书 此时客户端在转发http时,可提供选项将http自动转为https。 ### Describe alternatives you've considered _No response_ ### Affected area - [x] Docs - [ ] Installation - [ ] Performance and Scalability - [x] Security - [x] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [x] Client Plugin - [x] Server Plugin - [ ] Extensions - [ ] Others
gitea-mirror 2026-05-05 13:30:43 -06:00
Author
Owner

@ax2009live commented on GitHub (Aug 15, 2022):

http 转 https 不需要证书,
如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://.frps.xiaoming.com 自动转为 https://.frps.xiaoming.com

nginx 的 default.conf
server {
listen 80;
return 301 https://$host$request_uri;
}

<!-- gh-comment-id:1215934204 --> @ax2009live commented on GitHub (Aug 15, 2022): http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://*.frps.xiaoming.com 自动转为 https://*.frps.xiaoming.com nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }
Author
Owner

@xiaozhuai commented on GitHub (Aug 16, 2022):

http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://.frps.xiaoming.com 自动转为 https://.frps.xiaoming.com

nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }

你没看懂我说的意思哈,不是重定向。
我本地开启的服务是http的,我不想在本地配置https的证书,我想在frps即服务端将http转换为https,
同时为了不需要每个子域名都配置一次证书,希望frps支持通配符域名证书,这样配置一次证书即可。

<!-- gh-comment-id:1216095572 --> @xiaozhuai commented on GitHub (Aug 16, 2022): > http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://_.frps.xiaoming.com 自动转为 https://_.frps.xiaoming.com > > nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; } 你没看懂我说的意思哈,不是重定向。 我本地开启的服务是http的,我不想在本地配置https的证书,我想在frps即服务端将http转换为https, 同时为了不需要每个子域名都配置一次证书,希望frps支持通配符域名证书,这样配置一次证书即可。
Author
Owner

@ax2009live commented on GitHub (Aug 16, 2022):

我到现在都没搞清楚您的意思;frps 是支持通配符域名证书的,
我猜的您的意思可能如下:
访问 http://.frps.xiaoming.com 的时候,frps 会自动转换为 https 服务, 而 https 的服务内容调取的是 frpc 的 http 的内容

如果我的猜测是对的,我觉得实现起来有问题,会产生混乱,frpc : type = http 还是 type = https?
感觉你要得功能类似 nginx 转发,转发的内容为远端的 frpc 内容而已;
个人觉得 frp 的核心是 端口转发到内网,

<!-- gh-comment-id:1216256117 --> @ax2009live commented on GitHub (Aug 16, 2022): 我到现在都没搞清楚您的意思;frps 是支持通配符域名证书的, 我猜的您的意思可能如下: 访问 http://.frps.xiaoming.com 的时候,frps 会自动转换为 https 服务, 而 https 的服务内容调取的是 frpc 的 http 的内容 如果我的猜测是对的,我觉得实现起来有问题,会产生混乱,frpc : type = http 还是 type = https? 感觉你要得功能类似 nginx 转发,转发的内容为远端的 frpc 内容而已; 个人觉得 frp 的核心是 端口转发到内网,
Author
Owner

@xiaozhuai commented on GitHub (Aug 16, 2022):

访问 http://.frps.xiaoming.com 的时候,frps 会自动转换为 https 服务, 而 https 的服务内容调取的是 frpc 的 http 的内容

是这个意思
ngrok有这个功能,个人认为并不会有什么混乱的问题,且这是一个很好的功能。
frp的主要场景就是暴露本地开发机的端口到公网上,且https大部分时候都是必须的。
但是要知道,通常情况下开发机是没有ssl证书的,说白了就是开发人员不应该有权限获得证书,而应该由运维来管理证书,那么在frps配置通配符证书就很有必要。
而且就算开发机上有证书,如果每个服务都要去配置证书的话,不如在frps一次性配置通配符证书来的方便。
仅个人观点,抛砖引玉...

<!-- gh-comment-id:1216904082 --> @xiaozhuai commented on GitHub (Aug 16, 2022): > 访问 http://.frps.xiaoming.com 的时候,frps 会自动转换为 https 服务, 而 https 的服务内容调取的是 frpc 的 http 的内容 是这个意思 ngrok有这个功能,个人认为并不会有什么混乱的问题,且这是一个很好的功能。 frp的主要场景就是暴露本地开发机的端口到公网上,且https大部分时候都是必须的。 但是要知道,通常情况下开发机是没有ssl证书的,说白了就是开发人员不应该有权限获得证书,而应该由运维来管理证书,那么在frps配置通配符证书就很有必要。 而且就算开发机上有证书,如果每个服务都要去配置证书的话,不如在frps一次性配置通配符证书来的方便。 仅个人观点,抛砖引玉...
Author
Owner

@wxyShine commented on GitHub (May 8, 2024):

http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://.frps.xiaoming.com 自动转为 https://.frps.xiaoming.com
nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }

你没看懂我说的意思哈,不是重定向。 我本地开启的服务是http的,我不想在本地配置https的证书,我想在frps即服务端将http转换为https, 同时为了不需要每个子域名都配置一次证书,希望frps支持通配符域名证书,这样配置一次证书即可。

现在版本就支持,,通过ng配置就实现了

<!-- gh-comment-id:2099662861 --> @wxyShine commented on GitHub (May 8, 2024): > > http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://_.frps.xiaoming.com 自动转为 https://_.frps.xiaoming.com > > nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; } > > 你没看懂我说的意思哈,不是重定向。 我本地开启的服务是http的,我不想在本地配置https的证书,我想在frps即服务端将http转换为https, 同时为了不需要每个子域名都配置一次证书,希望frps支持通配符域名证书,这样配置一次证书即可。 现在版本就支持,,通过ng配置就实现了
Author
Owner

@litrycn commented on GitHub (Feb 27, 2025):

frp 现在已经支持 http转https的插件。你只需要配置为*.xxx.com即可

frps:

bindAddr = "0.0.0.0"
bindPort = 7000
vhostHTTPPort = 80
vhostHTTPSPort = 443

在frps 服务器上再启一个 frpc,配置为:

[[proxies]]
name = "plugin_https2http"
type = "https"
customDomains = ["*.yourdomain.com"]
[proxies.plugin]
type = "https2http"
localAddr = "127.0.0.1:80"
crtPath = "./server.crt"
keyPath = "./server.key"

自己本机配置为

[[proxies]]
name = "web02"
type = "http"
localIP = "127.0.0.1"
localPort = 8000
customDomains = ["web02.yourdomain.com"]

访问: https://web02.yourdomain.com
路由: Ruser -> frps -> frpc -> Local frp ->127.0.0.1:8000

<!-- gh-comment-id:2687609530 --> @litrycn commented on GitHub (Feb 27, 2025): frp 现在已经支持 http转https的插件。你只需要配置为*.xxx.com即可 frps: ``` bindAddr = "0.0.0.0" bindPort = 7000 vhostHTTPPort = 80 vhostHTTPSPort = 443 ``` 在frps 服务器上再启一个 frpc,配置为: ``` [[proxies]] name = "plugin_https2http" type = "https" customDomains = ["*.yourdomain.com"] [proxies.plugin] type = "https2http" localAddr = "127.0.0.1:80" crtPath = "./server.crt" keyPath = "./server.key" ``` 自己本机配置为 ``` [[proxies]] name = "web02" type = "http" localIP = "127.0.0.1" localPort = 8000 customDomains = ["web02.yourdomain.com"] ``` 访问: https://web02.yourdomain.com 路由: Ruser -> frps -> frpc -> Local frp ->127.0.0.1:8000
Author
Owner

@github-actions[bot] commented on GitHub (May 22, 2025):

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

<!-- gh-comment-id:2899586230 --> @github-actions[bot] commented on GitHub (May 22, 2025): Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d of inactivity and eventually close.
Author
Owner

@wxyShine commented on GitHub (May 22, 2025):

http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://.frps.xiaoming.com 自动转为 https://.frps.xiaoming.com
nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }

你没看懂我说的意思哈,不是重定向。 我本地开启的服务是http的,我不想在本地配置https的证书,我想在frps即服务端将http转换为https, 同时为了不需要每个子域名都配置一次证书,希望frps支持通配符域名证书,这样配置一次证书即可。

https://www.wxy97.com/archives/284c90ae-c88e-4928-b024-85380e995e06 可以参考 这个 ng监听frps的http端口通过ng实现https并在ng配置通配符证书

<!-- gh-comment-id:2899623288 --> @wxyShine commented on GitHub (May 22, 2025): > > http 转 https 不需要证书, 如你要自动 http 转 https,你可以在 frps 服务器端建立一个 frpc 客户端,实现 http://_.frps.xiaoming.com 自动转为 https://_.frps.xiaoming.com > > nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; }nginx 的 default.conf server { listen 80; return 301 https://$host$request_uri; } > > 你没看懂我说的意思哈,不是重定向。 我本地开启的服务是http的,我不想在本地配置https的证书,我想在frps即服务端将http转换为https, 同时为了不需要每个子域名都配置一次证书,希望frps支持通配符域名证书,这样配置一次证书即可。 https://www.wxy97.com/archives/284c90ae-c88e-4928-b024-85380e995e06 可以参考 这个 ng监听frps的http端口通过ng实现https并在ng配置通配符证书
Author
Owner

@github-actions[bot] commented on GitHub (Jun 6, 2025):

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

<!-- gh-comment-id:2947335485 --> @github-actions[bot] commented on GitHub (Jun 6, 2025): Issues go stale after 14d of inactivity. Stale issues rot after an additional 3d 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#2344
No description provided.