Return custom 404 response if caddy reverse_proxy returns 404

Viewed 107

I'm using caddy for dynamic ssl. I am using the reverse_proxy header and now I want to return a custom 404 response when the reverse_proxy returns a 404.

Is it possible? I looked at handle_erros directive but looks like it doesn't work with reverse_proxy. Here's a statement from the caddy doc.

Note that certain directives, for example, reverse_proxy which may write a response with an HTTP status which is classified as an error, will not trigger the error routes.

Is there a way to achieve what I want?

0 Answers
Related