Hello,
I have discovered when putting HFS behind a proxy that many of its HTTP responses are not standards compliant. HFS is unusable behind such a system.
HTTP 1.1 requires a header which will allow the client to determine the end of the response. In error pages and during redirects, HFS lacks this header. Some proxies give 502 BAD_GATEWAY errors when this occurs.
This header may be one of:
Content-Length: <valid # of bytes, can be 0>
Transfer-Encoding: chunked
Connection: close
This last option is what HFS is usually doing when it sends error or redirect pages since it seems to simply close the connection following the response. Browsers are generally tolerant of this where many proxies, load balancers, and web application firewalls are not.
I can work around the error with {.add header|Connection: close.} in [error-page] in the template but I cannot work around the redirect issue in the template. I do not believe HFS uses chunked transfers at all so the second option shouldn't ever be needed. Depending on how the persistent connections option works, Content-length: 0 may be needed during redirects or when returning error pages also.
Thanks for a nice little utility!