The issue: ---------- When using the directive "ProxyErrorOverride", it will intercept all responses with status codes between 400 (including) and 600 (excluding). But we need to "pass-through" certain responses like 401 or 404, and in some cases we only want to handle 50x responses all together. There was a similar feature-request once: https://bz.apache.org/bugzilla/show_bug.cgi?id=50732 The (proposed) solution: ------------------------ Changing the usage of "ProxyErrorOverride" appeared not like an ideal solution to me, so I introduced a new directive "ProxyErrorIntercept" in addition to it. When not specified in the config, the behaviour of "ProxyErrorOverride" is unchanged. If specified, "ProxyErrorOverride" will only consider responses with the configured status codes. Disclaimer: ----------- My skills in C are a bit rusty. So I appreciate any constructive feedback for the deficiencies that might be in my code.
Created attachment 36701 [details] Patch to support specifying the http status codes to be considered by ProxyErrorOverride
We're still blocked with our migration-project, due to this feature being missing. Any idea on when we can expect a response?
Created attachment 36979 [details] Patch ProxyErrorOverride to allow specifying custom codes I finally managed to implemented the changes proposed on the mailing-list: > I think the proxy_util.c additions need an ap_ prefix and need to be > declared like all of the other non-static functions with AP_DECLARE. Done (but used PROXY_DECLARE) > The description and the manual seem to hide the use of this for > non-error codes while the diff seems to go out of its way to allow > non-error codes. > I think it should either be constrained in the diff or have some > notes/warnings/elaboration in the doc. Good point. I also changed that in the implementation as well as documentation. > I personally do not like the use of two directives and the intercept > and override terminology mixing. I prefer that ProxyErrorOverride is > extended to accept ON or a list of status codes. I merged the directives to allow a list of status codes after the ON in the ProxyErrorOverride directive. > Another personal nit -- the name of the two added functions is not so > clear to me. I changed the name of at least one of the methods to make it less confusing. If you feel, that the naming still isn't optimal, I'm of course open for suggestions. > Also, is_proxy_error_intercept_code could be static (and not in > mod_proxy.h) or just part of the other method since it is only called > from the other method. You're right. Changed that as well.
Thanks for the enhancement, I've committed it in 1876404 with a handful of small changes for style/readability during review/test
Backported to v2.4.47. http://svn.apache.org/viewvc?rev=1885575&view=rev