Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: custom default error page #2430

Merged
merged 5 commits into from May 22, 2024
Merged

feat: custom default error page #2430

merged 5 commits into from May 22, 2024

Conversation

buchdag
Copy link
Member

@buchdag buchdag commented May 2, 2024

This PR allows to customise the default error page by mounting an HTML file to serve in its place.

Solve #1325

@buchdag buchdag added the type/feat PR for a new feature label May 2, 2024
@buchdag buchdag self-assigned this May 2, 2024
@buchdag buchdag linked an issue May 2, 2024 that may be closed by this pull request
internal;
}
{{- end }}
location ^~ / {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In case the user navigates to "example.com" or "www.example.com" he gets a 503, right?

If so: how to serve a custom root-Page without the need of a separate nginx serving just that root path?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not certain I understand the question. 🤔

This server block (the one which is modified) is a catch all for when you're requesting a hostname that does not exist on a particular instance of nginx-proxy (It's never used when real proxying takes place). The purpose of the PR is to allow customisation of the default error page you get when this happen.

The location block is required because having only return 503 does not trigger the error_page.

@buchdag
Copy link
Member Author

buchdag commented May 17, 2024

I'm not certain this PR should restore the nginx image's 50x page by default.

This would switch from this, which have been there since the beginning :

79203896-fd88e980-7e3b-11ea-9147-44908aa3e665

To this:

image

That's arguably easier to the eye but that might not be what users want as default either.

@Prime1Code any opinion on this ?

@Prime1Code
Copy link

Yes, I think so too. This error page should not be enabled by default.

But the option to add one is still a better customization option than without it.

@buchdag buchdag marked this pull request as draft May 20, 2024 12:44
@buchdag buchdag marked this pull request as ready for review May 21, 2024 14:11
docs/README.md Outdated Show resolved Hide resolved
@buchdag buchdag merged commit fb9c3a6 into main May 22, 2024
3 checks passed
@buchdag buchdag deleted the custom-error branch May 22, 2024 06:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feat PR for a new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom Nginx Error Messages?
2 participants