[GH-ISSUE #5015] Can't serve 404 page if https #3946

Closed
opened 2026-05-05 14:30:48 -06:00 by gitea-mirror · 4 comments
Owner

Originally created by @gregoiregentil on GitHub (Oct 9, 2025).
Original GitHub issue: https://github.com/fatedier/frp/issues/5015

Bug Description

First, thank you for this amazing project. It's very stable.

In 0.63, it's not possible to serve a 404 error page for https due to the lack of option to stipulate the certificate.

vhostHTTPPort = 80
vhostHTTPSPort = 443
custom404Page = "404.html"
#certFile = "/path/fullchain.pem"
#keyFile = "/path/privkey.pem"

Am I missing something or could it be "fixed"/added?

frpc Version

0.63.0

frps Version

0.63.0

System Architecture

Linux/amd64

Configurations

vhostHTTPPort = 80
vhostHTTPSPort = 443
custom404Page = "404.html"
#certFile = "/path/fullchain.pem"
#keyFile = "/path/privkey.pem"

Logs

http://example.com WORKING
2025-10-09 16:02:35.809 [W] [httputil/reverseproxy.go:486] do http proxy request [host: example.com] error: no route found: example.com /

https://example.com NOT WORKING
2025-10-09 16:02:34.464 [D] [vhost/vhost.go:218] http request for host [example.com] path [] httpUser [] not found

Steps to reproduce

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 @gregoiregentil on GitHub (Oct 9, 2025). Original GitHub issue: https://github.com/fatedier/frp/issues/5015 ### Bug Description First, thank you for this amazing project. It's very stable. In 0.63, it's not possible to serve a 404 error page for https due to the lack of option to stipulate the certificate. vhostHTTPPort = 80 vhostHTTPSPort = 443 custom404Page = "404.html" #certFile = "/path/fullchain.pem" #keyFile = "/path/privkey.pem" Am I missing something or could it be "fixed"/added? ### frpc Version 0.63.0 ### frps Version 0.63.0 ### System Architecture Linux/amd64 ### Configurations vhostHTTPPort = 80 vhostHTTPSPort = 443 custom404Page = "404.html" #certFile = "/path/fullchain.pem" #keyFile = "/path/privkey.pem" ### Logs http://example.com WORKING 2025-10-09 16:02:35.809 [W] [httputil/reverseproxy.go:486] do http proxy request [host: example.com] error: no route found: example.com / https://example.com NOT WORKING 2025-10-09 16:02:34.464 [D] [vhost/vhost.go:218] http request for host [example.com] path [] httpUser [] not found ### Steps to reproduce _No response_ ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [x] Security - [x] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [x] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Oct 11, 2025):

This is the current expected behavior. The custom404Page setting is applied after the request has been routed. For HTTPS, the server must first complete the TLS handshake and present a certificate before it can send any content. Today, frps does not expose a server-wide “default certificate” for the vhost HTTPS listener, so when a request doesn’t match any configured HTTPS proxy, there’s no cert to use and your custom 404 page can’t be returned. (You can see custom404Page, vhostHTTPPort, and vhostHTTPSPort in the server config reference, but there’s no global HTTPS certificate option there.)

<!-- gh-comment-id:3392807705 --> @fatedier commented on GitHub (Oct 11, 2025): This is the current expected behavior. The custom404Page setting is applied after the request has been routed. For HTTPS, the server must first complete the TLS handshake and present a certificate before it can send any content. Today, frps does not expose a server-wide “default certificate” for the vhost HTTPS listener, so when a request doesn’t match any configured HTTPS proxy, there’s no cert to use and your custom 404 page can’t be returned. (You can see custom404Page, vhostHTTPPort, and vhostHTTPSPort in the server config reference, but there’s no global HTTPS certificate option there.)
Author
Owner

@gregoiregentil commented on GitHub (Oct 11, 2025):

Thank you for the project and thank you for the answer.

I follow you. " Today, frps does not expose a server-wide “default certificate” for the vhost HTTPS listener". We agree and that's why I put "#certFile...". So my "issue" should be re-qualified as a "feature suggestion".

<!-- gh-comment-id:3392961069 --> @gregoiregentil commented on GitHub (Oct 11, 2025): Thank you for the project and thank you for the answer. I follow you. " Today, frps does not expose a server-wide “default certificate” for the vhost HTTPS listener". We agree and that's why I put "#certFile...". So my "issue" should be re-qualified as a "feature suggestion".
Author
Owner

@fatedier commented on GitHub (Oct 11, 2025):

Given how frp currently handles HTTPS, this isn’t possible. There are no plans to support it in the short term.

<!-- gh-comment-id:3392967284 --> @fatedier commented on GitHub (Oct 11, 2025): Given how frp currently handles HTTPS, this isn’t possible. There are no plans to support it in the short term.
Author
Owner

@gregoiregentil commented on GitHub (Oct 11, 2025):

Got you.

<!-- gh-comment-id:3393029515 --> @gregoiregentil commented on GitHub (Oct 11, 2025): Got you.
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#3946
No description provided.