tobychui / zoraxy

A general purpose HTTP reverse proxy and forwarding tool. Now written in Go!
https://zoraxy.arozos.com
GNU Affero General Public License v3.0
2.68k stars 159 forks source link

[ENHANCEMENTS] global 'error_page' for HTTP status codes #313

Open rai68 opened 1 day ago

rai68 commented 1 day ago

Is your feature request related to a problem? Please describe. Nope

Describe the solution you'd like Basically with NGINX or NPM I can use proxy_intercept_errors on; to use a global status page for each request where there may be an error.

error_page 404 /index_404.html;
location = /index_404.html {
  alias /data/nginx/custom/index_404.html;
  internal;
}

creates an error page here.

I feel like with Zoraxy you should be able to enable proxy intercept mode with error pages and the internal static web server.

And yea its probably not a normal thing to have global error pages since the reversed service should handle it but i like my global error pages

Describe alternatives you've considered Not really sure of an alternative perhaps use both Zoraxy and NPM behind it.

Additional context

tobychui commented 8 hours ago

Hi @rai68

Ok, that is an interesting idea. But there are some issues regarding this feature.

I think this feature enhancement worth an implementation sooner or later, but a detailed behavior definitions on how the proxy core is suppose to handle / let the upstream to handle and the scope of the error page is required. If you have interest to discuss this further, feel free to leave your thought and propose with a more detailed expected behavior of your "global error page" design 👍🏻