mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 01:15:51 +03:00
[GH-ISSUE #26] Add configurable error pages #26
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jc21 on GitHub (Nov 8, 2018).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/26
It would be nice to allow the user to specify the content for the following pages
@Daxx13 commented on GitHub (Dec 12, 2018):
+1 to this, will be a great enhancement.
@fauzie commented on GitHub (Jan 6, 2019):
+1
Waiting for this.
@didusee commented on GitHub (Jan 14, 2019):
+1
@ghallford commented on GitHub (Feb 26, 2019):
I would like the option to have the default page when no hostname is specified return just a 404 error message. Or just make it so that if anything is hit that is not a valid hostname proxy, it returns a 404 including if the default page is hit from the client using IP of the server in the URL
@papatistos commented on GitHub (Oct 25, 2020):
+1
Sorry if this is a dumb question, but what is currently the best work around for not exposing that page saying "Congratulations! You've successfully started the Nginx Proxy Manager"? My quick solution was to create a redirect host for my bare IP and redirect to some public website. So Whoever visits my IP will just be bounced back into the internet... :-)
@aosmirnov commented on GitHub (Jan 14, 2021):
This feature is really needful!
@Mohan-cloud commented on GitHub (Jan 22, 2021):
@tophee Is redirection to a public site still the best solution?
@l4rm4nd commented on GitHub (Nov 17, 2021):
@jc21 any updates or plans on this feature enhancement?
@PrzemekSkw commented on GitHub (Nov 19, 2021):
Hello, I also see that Congratulations page on my external IP. Can You tell how to make that redirection?
Regards.
@aosmirnov commented on GitHub (Nov 19, 2021):
You should go to settings page in web UI and change Default site settings from Congratulations page to 404 page or Custom HTML or configure a redirection.
@PrzemekSkw commented on GitHub (Nov 19, 2021):
Hi, thanks for Your answer. I miss that settings tab. I thougt I have to make someting in command line :D
Thanks.
@anoosa1 commented on GitHub (Dec 30, 2021):
Any updates? I really need this.
@ririko5834 commented on GitHub (Mar 12, 2022):
Its good idea to add way to setup custom html error pages for HTTP error codes, for example I want to replace this
with my own.
@DeltaLaboratory commented on GitHub (Mar 28, 2022):
still waiting
@adam-koller commented on GitHub (Apr 8, 2022):
same here, waiting.
@kylethedeveloper commented on GitHub (Apr 15, 2022):
Hi everyone,
I agree that this should be implemented in the UI but until then, I wanted to explain how I managed to do it so that you can too.
Create a directory named
error_pagesunder your/data/nginx/directory. Prepare your custom error pages and put them in there. These files will be persistent as I suppose that you mount/datadirectory to your host machine.After restarting your container; visit the dashboard, edit a proxy host, go to Advanced tab and paste the following with respect to the name of your error page file:
In this case, my error page filename is
error-cloud.htmlwhere HTTP code is one of 500, 502, 503 or 504.You can prepare different error pages for different hosts and also different error pages for different response codes. Hope this is helpful.
@webysther commented on GitHub (Sep 16, 2022):
Using HttpErrorPages with the solution of @kylethedeveloper:
This maybe can be the default inside NPM + HttpErrorPages @jc21
@eremid commented on GitHub (Oct 18, 2022):
You can add a file server_proxy.conf in your /data/nginx/custom with your content example to set the custom error page globaly :
Or comment
proxy_intercept_errors on;and just add this directive in the proxy host advanced configuration.@BobWs commented on GitHub (Jan 4, 2024):
I've added
server_proxy.confto/data/nginx/error_pages/(- /data/nginx/error_pages/server_proxy.conf)and the html pages but it isn't working! Do I still need to add the above to the advanced tab?How do I set this globaly in NPM?
@BobWs commented on GitHub (Jan 5, 2024):
How do you prepare different error codes for the same proxy host? e.g. If you want to have an 403 and 502 error page.
And also when I add an image to my custom 502 html error page the image doesn’t show but I use the same html code for the 404 custom page and then the image shows…very weird behavior.
@nickelswitte commented on GitHub (May 24, 2024):
Is it still planned to integrate this in the future?
@nickelswitte commented on GitHub (May 24, 2024):
Also, for anyone having the same issue as @BobWs, the
server_proxy.confhas to be created in/data/nginx/custom, not any other directory, such as/data/nginx/error_pages. Only then, it is being recognized by NPM.When I did this, I ran into another error:
It seems that this directive has been set somewhere else, and nginx does not accept duplicates. I could fix this by commenting out the ´proxy_intercept_errors on;´and now it is working beautifully.
Hope this helps someone.
@adrianmusante commented on GitHub (Jun 8, 2024):
I'm using this approach to handle errors and it works. Although I'd like to only show these error pages when the content-type is not an application/json because today API errors also end up returning HTML. Has anyone else encountered this and found a solution? Thank you in advance
@BobWs commented on GitHub (Jun 9, 2024):
I was using the same approach for a general error_page handling for all my proxy hosts, but that resulted in conflict with some of my docker apps for which I was using NPM. For example Mattermost and Vaultwarden 2FA didn't work anymore when I set the error_page in the general approach, as soon as I removed this then Mattermost and Vaultwarden 2FA started working again.
So now I'm using the error_page on individual base only for the apps that need a error_page to inform users.
@Alex-Goaga commented on GitHub (Jun 12, 2024):
I followed this tutorial exactly to create a custom html 403 page but even with the help of chat gpt i cant make it work . I am trying to test via proxy sites
i am using docker to keep up and running npm using the following compose
I created the server_proxy.conf /mnt/containers/nginx-proxy-manager/container-data/data/nginx/custom/ with the following lines
In the /mnt/containers/nginx-proxy-manager/container-data/data/nginx/error_pages/ i created the HTTP403.html file
and in the Custom Nginx Configuration tab i have
I dont know whats missing, when i try to remote accees it to get the 403 error page , i just receive the classic drop
@adrianmusante commented on GitHub (Jun 12, 2024):
You need to add
proxy_intercept_errors on;on server proxy.conf or advanced settings where you want that page works.@Alex-Goaga commented on GitHub (Jun 12, 2024):
Tried in both locations : /mnt/containers/nginx-proxy-manager/container-data/data/nginx/custom/server_proxy.conf or Custom Nginx Configuration with a simplified idea of
proxy_intercept_errors on;
deny all;
Still receving 403 Forbidden, what i can test more ?
@adrianmusante commented on GitHub (Jun 12, 2024):
@Alex-Goaga
I can't think of what the error could be. I would recommend you try:
proxy_intercept_errors enabled;). In this way, check if there is any conflict between configurations./data/logs/proxy-host-<ID>_access.logand/data/logs/proxy-host-<ID>_error.log. You can find the ID, inside the files that are in/data/nginx/proxy_host. This directory contains the final configuration files for each proxy that are generated from the administrator UI.@BobWs commented on GitHub (Jun 13, 2024):
@Alex-Goaga
Have you check the permissions of the folders and error_pages you created if they are set right?
@github-actions[bot] commented on GitHub (Dec 24, 2024):
Issue is now considered stale. If you want to keep it open, please comment 👍
@github-actions[bot] commented on GitHub (Jan 4, 2026):
Issue was closed due to inactivity.