Hi all.
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:
<VirtualHost *:80>
ServerAdmin webmaster@example.com
ServerName example.com
ServerAlias www.example.com
ErrorLog ${APACHE_LOG_DIR}/vhosts/example.com/error.log
CustomLog ${APACHE_LOG_DIR}/vhosts/example.com/access.log combined
<IfModule proxy_module>
## <https://meta.discourse.org/t/running-other-websites-on-the-same-machine-as-discourse/17247>
ProxyPreserveHost on
RequestHeader set X-Forwarded-Proto expr=%{REQUEST_SCHEME}
RequestHeader set X-Real-IP expr=%{REMOTE_ADDR}
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
</IfModule>
</VirtualHost>
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!