I am trying to set up Discourse in a Docker container. The host environment (Debian) is running an Apache httpd server (I can’t run nginx because I’m hosting other sites on Apache). I want to use mod_proxy to reverse-proxy to the container, which is listening on port 3000.
Apache’s current config for this vhost is as follows:
I started with just the ProxyPass and ProxyPassReverse directives and added ProxyPreserveHost and the RequestHeader directives one at time. No matter how I configure the proxy using these directives, certain files below the document root return 404 when accessed (for example stuff in /images and /assets).
Note the comment containing the Discourse Meta URL that I converted from nginx syntax to Apache.
Any thoughts on how to get this to work would be much appreciated!
HAProxy does what I’m after and looks like a very polished and useful tool. Thanks for the pointer.
However, it seems that editing templates/web*.yml to listen on ports other than the defaults of 80 and 443 was where the trouble was. I restored the default configs then edited containser/app.yml to have lines similar to the following, and the 404 errors went away:
I’ve been really happy with traefik lately, and it’ll do let’s encrypt certificates automatically (you can do that with HA-Proxy too, it’s just a bit more work.)