I'm doing some special error pages but because of things, they're one hop away though, meaning all that's left in the address bar is a cleaned up address with a 3-character-long path.
I want to, hopefully, do something like this:
- Client attempts to get resource
- Resource ain't there / server fails;
404
,503
, etc… thus,- Server (Apache httpd) serves:
- In {
httpd
|apache2
}.conf
:ErrorDocument 503 http://xxx/503.html?ref={someMagicMacroCodeOrSomething}
- In {
- If not attended directly by Apache then the proxy (HAProxy) can intercept the server's response and do a more powerful redirection-decomposition-voodoo,
303
redirect, HAProxy can easily alter the URL, maybe even send it as POST request, or,200
, with meta refresh, JavaScript, maybe. IDK.
— Even internally, most things go through the proxy in order to inject CSPs to prevent unvetted web apps from loading thing from third party domains. This is more likely.
- Server (Apache httpd) serves:
- Server hosting the error page serves it (as
200
) with the URL that triggered the redirect in some sort of placeholder surrounded by gorgeous graphics or perhaps something out of a hospital's guest Wi-Fi, but at least more useful than a page without reference or the stock error codes.
— It's okay for the user to know about the 400/500 error, that's the whole point, but it's not okay for the user agent to know about the error.
The final page, or the server for that matter, is not supposed to process the information passed along from the referrer page; I read this might be make this a vulnerability that could be use to inject stuff, fortunately I don't need to run analytics or anything with this, it's meant to inform the user only, it doesn't even need to be sent to the server at all – although I'm failing to see how, considering it's the server the one that would've had initiated the redirect in this case, right? — it could be something client-side only. The only requisite is to show the address it was redirected from.
Ideally, any static site web server should be enough to host the error documents. That rules out PHP, Node.js, .NET Core-d--duo-ultra..whatever cumbersome thing Microsoft is pushing lately. So… bare NGINX, or Apache httpd (with standard modules if needed), but it seems like it can do a lot of things just on its own, e.g; mod_status
, Dynamic Shared Objects, and JavaScript I suppose, as long as it does not relies and the browser's history data or any invasive means.
Is this possible at all? I appreciate your advice on this, other suggestions are welcome too. Thanks!