Being able to customize the upstream proxy errors #7226
Replies: 17 comments 2 replies
-
Also the default |
Beta Was this translation helpful? Give feedback.
-
This would make sense, I'm just starting to use Kong and really surprised to not see this functionality at all! |
Beta Was this translation helpful? Give feedback.
-
I was trying to work around this with:
but it seems to have no effect. |
Beta Was this translation helpful? Give feedback.
-
The error I am trying to customize is the 403 coming from the |
Beta Was this translation helpful? Give feedback.
-
For anyone trying to do the same: I needed to add:
to the Nginx configuration for upstream errors to be passed to Instead, 40x produced by a plugin (like |
Beta Was this translation helpful? Give feedback.
-
(Possibly) traced the problem to the lua module, asking there: openresty/lua-nginx-module#875 |
Beta Was this translation helpful? Give feedback.
-
@thefosk Is there some news about this feature? |
Beta Was this translation helpful? Give feedback.
-
@arno-di-loreto we want to introduce this capability but currently we have other priorities. The only way today is to fork the plugins and change the message manually - but we want to provide an easier way. |
Beta Was this translation helpful? Give feedback.
-
Hey @thefosk @Tieske @thibaultcha |
Beta Was this translation helpful? Give feedback.
-
Hi, any news about this? If not, anyone would be able to point out a fork with some progress about it? |
Beta Was this translation helpful? Give feedback.
-
@tetebueno there is a hack that we did. Overriding the kong.tools.response file. |
Beta Was this translation helpful? Give feedback.
-
Hi @mwaaas , we are after this feature too, can you please tell us how you changed kong.tools.response? |
Beta Was this translation helpful? Give feedback.
-
Hi, anyone got a working sample for achieving this, customising the error message? appreciate any help thanks |
Beta Was this translation helpful? Give feedback.
-
@takearun created a folder called kong/tools and added response file to the directory, then added my directory to the lua path, in that way when Kong tries to import kong.tools.response it would import my file. Let me know if that helps. |
Beta Was this translation helpful? Give feedback.
-
Is this implemented yet ? |
Beta Was this translation helpful? Give feedback.
-
So this issue is opened on Feb 9, 2016, we're like 3 weeks from 2022 and almost 6 years from original request - is there easy way to show our customized pages? Or where can I find a good resources that will help me understand how to achieve this? |
Beta Was this translation helpful? Give feedback.
-
Being able to customize the upstream error responses being returned by
proxy_pass
, by allowing to override the current templates.The user would need to provide their own templates for all the response formats that we support.
Beta Was this translation helpful? Give feedback.
All reactions