diff --git a/cfgov/apache/conf.d/proxy.conf b/cfgov/apache/conf.d/proxy.conf new file mode 100644 index 00000000000..af16ce6f441 --- /dev/null +++ b/cfgov/apache/conf.d/proxy.conf @@ -0,0 +1,11 @@ +# This file is only used when running Apache and the application +# containerized. This configures Apache to ProxyPass to the application +# container when CFGOV_APPLICATION_HOST is defined in the environment. +# +# TODO: Remove the RewriteCond and switch to a simple ProxyPass when the +# application is moved to Gunicorn. +ServerName https://www.consumerfinance.gov + +RewriteCond expr "-n env('CFGOV_APPLICATION_HOST')" +RewriteRule ^/(.*)$ http://${CFGOV_APPLICATION_HOST}:8000/$1 [P,L] +ProxyPassReverse / http://${CFGOV_APPLICATION_HOST}:8000/ diff --git a/cfgov/apache/conf.d/wsgi.conf.venv b/cfgov/apache/conf.d/wsgi.conf.venv index 02fb2185731..1b398f1991c 100644 --- a/cfgov/apache/conf.d/wsgi.conf.venv +++ b/cfgov/apache/conf.d/wsgi.conf.venv @@ -1,3 +1,7 @@ +# Our classic mod_wsgi deployment will move this file into place if we're +# expecting to use mod_wsgi. +# TODO: Remove when the application is containerized or moved to Gunicorn + ServerName https://www.consumerfinance.gov LoadModule wsgi_module modules/mod_${SCL_PYTHON_VERSION}-wsgi.so