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

Custom error html page #11313

Closed
feature-id opened this issue May 25, 2020 · 7 comments · Fixed by #13019
Closed

Custom error html page #11313

feature-id opened this issue May 25, 2020 · 7 comments · Fixed by #13019
Labels

Comments

@feature-id
Copy link

Hi.

Is it possible to replace 50X status replies with some custom html page + 200 OK, like nginx or haproxy do with error_page directive? (they use internal redirect for that, afaiu)

Did some search and found that #11007 is already merged, but looks like this is for local pages only and not for html?

@mattklein123
Copy link
Member

I will mark this help wanted. I think this is a fairly simple change to allow the content-type to be set as part of the reply mapper. @qiwzhang wdyt?

@feature-id
Copy link
Author

feature-id commented Jun 4, 2020

I'd agree even with the option to leave content-type not touched by envoy, if that makes sense (in our case backend sets this header).
Is it possible to get this feature in 1.15.0 release?

@SolovyevAndrei
Copy link

Hello

We need such feature too. Want to show beatiful error page to customers, when something is wrong with our backends.
It was quite easy with error_page in nginx. But no such possibility in envoy.

@deveshkandpal24121990
Copy link
Contributor

@mattklein123 - I would like to work on this issue. Can you please assign this to me ?

@dio
Copy link
Member

dio commented Sep 9, 2020

@mattklein123 for modifying proxied response (with non-2xx status), do you think it makes sense to have an error_page filter? (or to extend the local reply to work in response path; in Nginx, we need to turn on proxy_intercept_errors to let non-2xx proxied response to be handled by the proxy's error_page config).

I can see it can also be implemented in Lua (with some thinking on how to not complicate the "state management" there).

@mattklein123
Copy link
Member

@mattklein123 for modifying proxied response (with non-2xx status), do you think it makes sense to have an error_page filter? (or to extend the local reply to work in response path; in Nginx, we need to turn on proxy_intercept_errors to let non-2xx proxied response to be handled by the proxy's error_page config).

Sorry what is the use case here? To intercept upstream responses and translate them? This seems out of scope for local reply mapping?

@dio
Copy link
Member

dio commented Sep 9, 2020

@mattklein123 True, sorry that I wrongly submitted the comment here 😅. Seems like I wanted to reply on this issue: #12883.

htuch pushed a commit that referenced this issue Sep 16, 2020
…#13019)

Prior to this fix only text_format and json_format were supported which would result in text/plain or application/json content-type. This Introduces content_type field which supports setting content-type for body_format / body_format_override in local_reply_config.

Risk Level: low
Testing: Unit Testing, Manual Testing
Docs Changes: Introduces new field content_type in substitution_format_string.proto that supports setting content-type for body_format / body_format_override in local_reply_config.
Release Notes: Added release notes.

Fixes #11313

Co-authored-by: Devesh Kandpal <[email protected]>
esmet pushed a commit to datawire/envoy that referenced this issue Oct 28, 2020
…envoyproxy#13019)

Prior to this fix only text_format and json_format were supported which would result in text/plain or application/json content-type. This Introduces content_type field which supports setting content-type for body_format / body_format_override in local_reply_config.

Risk Level: low
Testing: Unit Testing, Manual Testing
Docs Changes: Introduces new field content_type in substitution_format_string.proto that supports setting content-type for body_format / body_format_override in local_reply_config.
Release Notes: Added release notes.

Fixes envoyproxy#11313

Co-authored-by: Devesh Kandpal <[email protected]>
(cherry picked from commit a8b946e)
LukeShu pushed a commit to datawire/envoy that referenced this issue Aug 10, 2021
…envoyproxy#13019)

Prior to this fix only text_format and json_format were supported which would result in text/plain or application/json content-type. This Introduces content_type field which supports setting content-type for body_format / body_format_override in local_reply_config.

Risk Level: low
Testing: Unit Testing, Manual Testing
Docs Changes: Introduces new field content_type in substitution_format_string.proto that supports setting content-type for body_format / body_format_override in local_reply_config.
Release Notes: Added release notes.

Fixes envoyproxy#11313

Co-authored-by: Devesh Kandpal <[email protected]>
(cherry picked from commit a8b946e)
aidanhahn pushed a commit to datawire/envoy that referenced this issue Aug 12, 2021
…envoyproxy#13019)

Prior to this fix only text_format and json_format were supported which would result in text/plain or application/json content-type. This Introduces content_type field which supports setting content-type for body_format / body_format_override in local_reply_config.

Risk Level: low
Testing: Unit Testing, Manual Testing
Docs Changes: Introduces new field content_type in substitution_format_string.proto that supports setting content-type for body_format / body_format_override in local_reply_config.
Release Notes: Added release notes.

Fixes envoyproxy#11313

Co-authored-by: Devesh Kandpal <[email protected]>
(cherry picked from commit a8b946e)
LukeShu pushed a commit to datawire/envoy that referenced this issue Aug 13, 2021
…envoyproxy#13019)

Prior to this fix only text_format and json_format were supported which would result in text/plain or application/json content-type. This Introduces content_type field which supports setting content-type for body_format / body_format_override in local_reply_config.

Risk Level: low
Testing: Unit Testing, Manual Testing
Docs Changes: Introduces new field content_type in substitution_format_string.proto that supports setting content-type for body_format / body_format_override in local_reply_config.
Release Notes: Added release notes.

Fixes envoyproxy#11313

Co-authored-by: Devesh Kandpal <[email protected]>
(cherry picked from commit a8b946e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants