Comments (20)
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_pages
under 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 /data
directory 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:
# Error page for 50x
error_page 500 502 503 504 /error-cloud.html;
proxy_intercept_errors on;
location /error-cloud.html {
internal;
root /data/nginx/error_pages;
}
In this case, my error page filename is error-cloud.html
where 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.
from nginx-proxy-manager.
You can add a file server_proxy.conf in your /data/nginx/custom with your content example to set the custom error page globaly :
error_page 400 /error_pages/HTTP400.html;
error_page 401 /error_pages/HTTP402.html;
error_page 402 /error_pages/HTTP402.html;
error_page 403 /error_pages/HTTP403.html;
error_page 404 /error_pages/HTTP404.html;
error_page 500 /error_pages/HTTP500.html;
error_page 501 /error_pages/HTTP501.html;
error_page 502 /error_pages/HTTP502.html;
error_page 503 /error_pages/HTTP503.html;
proxy_intercept_errors on;
location /error_pages/ {
alias /data/nginx/error_pages/;
internal;
}
Or comment proxy_intercept_errors on;
and just add this directive in the proxy host advanced configuration.
from nginx-proxy-manager.
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.
from nginx-proxy-manager.
Using HttpErrorPages with the solution of @kylethedeveloper:
location / {
# ... all other configuration
error_page 400 /error_pages/HTTP400.html;
error_page 401 /error_pages/HTTP402.html;
error_page 402 /error_pages/HTTP402.html;
error_page 403 /error_pages/HTTP403.html;
error_page 404 /error_pages/HTTP404.html;
error_page 500 /error_pages/HTTP500.html;
error_page 501 /error_pages/HTTP501.html;
error_page 502 /error_pages/HTTP502.html;
error_page 503 /error_pages/HTTP503.html;
proxy_intercept_errors on;
}
location /error_pages/ {
alias /data/nginx/error_pages/;
internal;
}
This maybe can be the default inside NPM + HttpErrorPages @jc21
from nginx-proxy-manager.
default page when no matching hostname is configured
+1 to this, will be a great enhancement.
from nginx-proxy-manager.
+1
Waiting for this.
from nginx-proxy-manager.
+1
from nginx-proxy-manager.
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
from nginx-proxy-manager.
+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... :-)
from nginx-proxy-manager.
It would be nice to allow the user to specify the content for the following pages
- upstream 404
- upstream 500
- upstream unavailable error
- default page when no matching hostname is configured
This feature is really needful!
from nginx-proxy-manager.
@tophee Is redirection to a public site still the best solution?
from nginx-proxy-manager.
@jc21 any updates or plans on this feature enhancement?
from nginx-proxy-manager.
+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... :-)
Hello, I also see that Congratulations page on my external IP. Can You tell how to make that redirection?
Regards.
from nginx-proxy-manager.
+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... :-)Hello, I also see that Congratulations page on my external IP. Can You tell how to make that redirection? Regards.
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.
from nginx-proxy-manager.
Hi, thanks for Your answer. I miss that settings tab. I thougt I have to make someting in command line :D
Thanks.
from nginx-proxy-manager.
Any updates? I really need this.
from nginx-proxy-manager.
still waiting
from nginx-proxy-manager.
same here, waiting.
from nginx-proxy-manager.
I've added server_proxy.conf
to /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?
from nginx-proxy-manager.
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_pages
under 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/data
directory 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:
# Error page for 50x error_page 500 502 503 504 /error-cloud.html; proxy_intercept_errors on; location /error-cloud.html { internal; root /data/nginx/error_pages; }
In this case, my error page filename is
error-cloud.html
where 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.
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.
from nginx-proxy-manager.
Related Issues (20)
- [SECURITY] Possible Security Vuln HOT 3
- NPM template, or at mimimum copy a configuration
- Make "NPM automatically create custom DNS with pihole" an option.
- Internal error (to do with NodeJS?) when trying to make an SSL certificate HOT 3
- Can't create or renew certs because of SSLError(SSLError(1, '[SSL: TLSV1_UNRECOGNIZED_NAME] tlsv1 unrecognized name (_ssl.c:992)')). HOT 1
- Internal Error: josepy.errors.DeserializationError: Deserialization error: Expecting value: line 1 column 1 (char 0) HOT 1
- Response Header from /subfolder are wrong or missing HOT 1
- How to specify Custom locations correctly HOT 6
- Statistics on the dashboard HOT 1
- NginxProxyManager Cors
- How do you configure redirects just on the local IP address? HOT 2
- Strato DNS change not working HOT 1
- Toggling "HSTS Enabled" leads to "Unknown hsts_header variable" error with proxy offline
- Ability to edit Let's Encrypt certificate DNS challenge options HOT 3
- How to change ssl receiving host?
- Error creating wilcard ssl certificate with cloudflare HOT 2
- A new /data/compose/3/v<x> directory is created with a vanilla database.sqlite whenever i pull new releases HOT 4
- 'force HTTPS' switch not recognized when creating new (proxy) host
- ACLs does not work when using rootless
- Cache purge for specific proxy host
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-proxy-manager.