[GH-ISSUE #1154] Modify "The page you visit not found" Default Error Page Into Own Designed 404 Error Page #902

Closed
opened 2026-05-05 12:34:25 -06:00 by gitea-mirror · 8 comments
Owner

Originally created by @jerrychong25 on GitHub (Mar 24, 2019).
Original GitHub issue: https://github.com/fatedier/frp/issues/1154

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

What operating system and processor architecture are you using (go env)?
Linux

Configures you used:
N/A

Steps to reproduce the issue:

  1. Set subdomain configuration in frpc.ini and frps.ini.
  2. Access non-configured subdomain name.
  3. It will displays "The page you visit not found." for all non-configured subdomain names.

Describe the results you received:
image

Describe the results you expected:
I would like to modify this default error page into own designed 404 error page.
(Example: https://blog.hubspot.com/blog/tabid/6307/bid/33766/10-clever-website-error-messages-from-creative-companies.aspx)

How could I achieve this?

Thanks.

Additional information you deem important (e.g. issue happens only occasionally):
N/A

Can you point out what caused this issue (optional)
N/A

Originally created by @jerrychong25 on GitHub (Mar 24, 2019). Original GitHub issue: https://github.com/fatedier/frp/issues/1154 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.24.1 **What operating system and processor architecture are you using (`go env`)?** Linux **Configures you used:** N/A **Steps to reproduce the issue:** 1. Set subdomain configuration in _frpc.ini_ and _frps.ini_. 2. Access non-configured subdomain name. 3. It will displays "**The page you visit not found.**" for all non-configured subdomain names. **Describe the results you received:** ![image](https://user-images.githubusercontent.com/15714095/54877805-b01b9200-4e5e-11e9-87fa-6f4800d30be7.png) **Describe the results you expected:** I would like to modify this default error page into own designed 404 error page. (Example: https://blog.hubspot.com/blog/tabid/6307/bid/33766/10-clever-website-error-messages-from-creative-companies.aspx) How could I achieve this? Thanks. **Additional information you deem important (e.g. issue happens only occasionally):** N/A **Can you point out what caused this issue (optional)** N/A
Author
Owner

@lou-lan commented on GitHub (Mar 24, 2019):

github.com/fatedier/frp/utils/vhost/resource.go

<!-- gh-comment-id:475970953 --> @lou-lan commented on GitHub (Mar 24, 2019): github.com/fatedier/frp/utils/vhost/resource.go
Author
Owner

@jerrychong25 commented on GitHub (Mar 25, 2019):

github.com/fatedier/frp/utils/vhost/resource.go

Thanks for pointing out the location of this error page. I will modify it here.

Anyway, how could I recompile this latest source code with modified resource.go into linux executable file frps?

This is my first time dealing with Go source codes.

Thanks.

<!-- gh-comment-id:476021504 --> @jerrychong25 commented on GitHub (Mar 25, 2019): > github.com/fatedier/frp/utils/vhost/resource.go Thanks for pointing out the location of this error page. I will modify it here. Anyway, how could I recompile this **latest source code with modified resource.go** into linux executable file **frps**? This is my first time dealing with Go source codes. Thanks.
Author
Owner

@lou-lan commented on GitHub (Mar 25, 2019):

git clone https://github.com/fatedier/frp.git

# edit resource.go
# cat Makefile

make frps
<!-- gh-comment-id:476031413 --> @lou-lan commented on GitHub (Mar 25, 2019): ```shell git clone https://github.com/fatedier/frp.git # edit resource.go # cat Makefile make frps ```
Author
Owner

@jerrychong25 commented on GitHub (Mar 28, 2019):

@lou-lan,

I faced following error when running make frps, as per screenshot below:
frps make issue

Error Logs:

[root@system frp]# make frps
go build -o bin/frps ./cmd/frps
go: finding github.com/fatedier/kcp-go v0.0.0-20171023144637-cd167d2f15f4
go: finding github.com/hashicorp/yamux v0.0.0-20180314200745-2658be15c5f0
go: github.com/fatedier/kcp-go@v0.0.0-20171023144637-cd167d2f15f4: unknown revision cd167d2f15f4
go: github.com/hashicorp/yamux@v0.0.0-20180314200745-2658be15c5f0: unknown revision 2658be15c5f0
go: error loading module requirements
make: *** [frps] Error 1

FYI. I used commit cbf9c73 (Version: 0.24.1) to compile this frps.

Could advise on this?

Thanks.

<!-- gh-comment-id:477541106 --> @jerrychong25 commented on GitHub (Mar 28, 2019): @lou-lan, I faced following error when running make frps, as per screenshot below: ![frps make issue](https://user-images.githubusercontent.com/15714095/55151230-beccb680-5188-11e9-8541-41c2039acaf6.JPG) Error Logs: ``` [root@system frp]# make frps go build -o bin/frps ./cmd/frps go: finding github.com/fatedier/kcp-go v0.0.0-20171023144637-cd167d2f15f4 go: finding github.com/hashicorp/yamux v0.0.0-20180314200745-2658be15c5f0 go: github.com/fatedier/kcp-go@v0.0.0-20171023144637-cd167d2f15f4: unknown revision cd167d2f15f4 go: github.com/hashicorp/yamux@v0.0.0-20180314200745-2658be15c5f0: unknown revision 2658be15c5f0 go: error loading module requirements make: *** [frps] Error 1 ``` FYI. I used commit **cbf9c73 (Version: 0.24.1**) to compile this frps. Could advise on this? Thanks.
Author
Owner

@lou-lan commented on GitHub (Mar 28, 2019):

# step1
# install go
go env
cd $GOPATH
mkdir -p src/github.com/fatedier
git clone https://github.com/fatedier/frp.git
# step2
# edit resource.go
# make frps or make build
make build 
<!-- gh-comment-id:477552476 --> @lou-lan commented on GitHub (Mar 28, 2019): ```bash # step1 # install go go env cd $GOPATH mkdir -p src/github.com/fatedier git clone https://github.com/fatedier/frp.git ``` ```bash # step2 # edit resource.go # make frps or make build make build ```
Author
Owner

@fatedier commented on GitHub (Mar 28, 2019):

@jerrychong25 Try the latest version.

<!-- gh-comment-id:477574217 --> @fatedier commented on GitHub (Mar 28, 2019): @jerrychong25 Try the latest version.
Author
Owner

@jerrychong25 commented on GitHub (Mar 29, 2019):

@lou-lan and @fatedier,

I checked out latest version 0.25.3 and recompile using make frps.

And it is running without any issues now.

Build Logs:

[root@exabytes-16713680 frp]# make frps
go build -o bin/frps ./cmd/frps
go: finding github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d
go: finding github.com/fatedier/kcp-go v2.0.4-0.20190317085623-2063a803e6fe+incompatible
go: finding github.com/klauspost/cpuid v1.2.0
go: finding github.com/klauspost/reedsolomon v1.9.1
go: downloading github.com/spf13/cobra v0.0.3
go: downloading github.com/fatedier/golib v0.0.0-20181107124048-ff8cd814b049
go: downloading github.com/rakyll/statik v0.1.1
go: downloading github.com/fatedier/beego v0.0.0-20171024143340-6c6a4f5bd5eb
go: downloading github.com/gorilla/mux v1.6.2
go: downloading github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d
go: extracting github.com/rakyll/statik v0.1.1
go: extracting github.com/fatedier/golib v0.0.0-20181107124048-ff8cd814b049
go: downloading github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec
go: downloading golang.org/x/crypto v0.0.0-20180505025534-4ec37c66abab
go: downloading golang.org/x/net v0.0.0-20180524181706-dfa909b99c79
go: downloading github.com/fatedier/kcp-go v2.0.4-0.20190317085623-2063a803e6fe+incompatible
go: downloading github.com/golang/snappy v0.0.0-20170215233205-553a64147049
go: extracting github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d
go: extracting github.com/gorilla/mux v1.6.2
go: extracting github.com/spf13/cobra v0.0.3
go: downloading github.com/spf13/pflag v1.0.1
go: extracting github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec
go: extracting github.com/fatedier/kcp-go v2.0.4-0.20190317085623-2063a803e6fe+incompatible
go: downloading github.com/templexxx/xor v0.0.0-20170926022130-0af8e873c554
go: downloading github.com/pkg/errors v0.8.0
go: extracting github.com/golang/snappy v0.0.0-20170215233205-553a64147049
go: downloading github.com/klauspost/reedsolomon v1.9.1
go: extracting github.com/fatedier/beego v0.0.0-20171024143340-6c6a4f5bd5eb
go: downloading github.com/tjfoc/gmsm v0.0.0-20171124023159-98aa888b79d8
go: extracting github.com/templexxx/xor v0.0.0-20170926022130-0af8e873c554
go: extracting github.com/spf13/pflag v1.0.1
go: extracting github.com/pkg/errors v0.8.0
go: extracting github.com/tjfoc/gmsm v0.0.0-20171124023159-98aa888b79d8
go: extracting github.com/klauspost/reedsolomon v1.9.1
go: extracting golang.org/x/crypto v0.0.0-20180505025534-4ec37c66abab
go: downloading github.com/klauspost/cpuid v1.2.0
go: extracting golang.org/x/net v0.0.0-20180524181706-dfa909b99c79
go: extracting github.com/klauspost/cpuid v1.2.0

Thanks for the great help =)

<!-- gh-comment-id:477844498 --> @jerrychong25 commented on GitHub (Mar 29, 2019): @lou-lan and @fatedier, I checked out latest version **0.25.3** and recompile using `make frps`. And it is running without any issues now. Build Logs: ``` [root@exabytes-16713680 frp]# make frps go build -o bin/frps ./cmd/frps go: finding github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d go: finding github.com/fatedier/kcp-go v2.0.4-0.20190317085623-2063a803e6fe+incompatible go: finding github.com/klauspost/cpuid v1.2.0 go: finding github.com/klauspost/reedsolomon v1.9.1 go: downloading github.com/spf13/cobra v0.0.3 go: downloading github.com/fatedier/golib v0.0.0-20181107124048-ff8cd814b049 go: downloading github.com/rakyll/statik v0.1.1 go: downloading github.com/fatedier/beego v0.0.0-20171024143340-6c6a4f5bd5eb go: downloading github.com/gorilla/mux v1.6.2 go: downloading github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d go: extracting github.com/rakyll/statik v0.1.1 go: extracting github.com/fatedier/golib v0.0.0-20181107124048-ff8cd814b049 go: downloading github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec go: downloading golang.org/x/crypto v0.0.0-20180505025534-4ec37c66abab go: downloading golang.org/x/net v0.0.0-20180524181706-dfa909b99c79 go: downloading github.com/fatedier/kcp-go v2.0.4-0.20190317085623-2063a803e6fe+incompatible go: downloading github.com/golang/snappy v0.0.0-20170215233205-553a64147049 go: extracting github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d go: extracting github.com/gorilla/mux v1.6.2 go: extracting github.com/spf13/cobra v0.0.3 go: downloading github.com/spf13/pflag v1.0.1 go: extracting github.com/vaughan0/go-ini v0.0.0-20130923145212-a98ad7ee00ec go: extracting github.com/fatedier/kcp-go v2.0.4-0.20190317085623-2063a803e6fe+incompatible go: downloading github.com/templexxx/xor v0.0.0-20170926022130-0af8e873c554 go: downloading github.com/pkg/errors v0.8.0 go: extracting github.com/golang/snappy v0.0.0-20170215233205-553a64147049 go: downloading github.com/klauspost/reedsolomon v1.9.1 go: extracting github.com/fatedier/beego v0.0.0-20171024143340-6c6a4f5bd5eb go: downloading github.com/tjfoc/gmsm v0.0.0-20171124023159-98aa888b79d8 go: extracting github.com/templexxx/xor v0.0.0-20170926022130-0af8e873c554 go: extracting github.com/spf13/pflag v1.0.1 go: extracting github.com/pkg/errors v0.8.0 go: extracting github.com/tjfoc/gmsm v0.0.0-20171124023159-98aa888b79d8 go: extracting github.com/klauspost/reedsolomon v1.9.1 go: extracting golang.org/x/crypto v0.0.0-20180505025534-4ec37c66abab go: downloading github.com/klauspost/cpuid v1.2.0 go: extracting golang.org/x/net v0.0.0-20180524181706-dfa909b99c79 go: extracting github.com/klauspost/cpuid v1.2.0 ``` Thanks for the great help =)
Author
Owner

@LinboLen commented on GitHub (May 5, 2025):

right now can use

# custom 404 page for HTTP requests
custom404Page = "/404.html"
<!-- gh-comment-id:2851101546 --> @LinboLen commented on GitHub (May 5, 2025): right now can use ``` # custom 404 page for HTTP requests custom404Page = "/404.html" ```
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#902
No description provided.