Skip to content

Commit

Permalink
WIP Limit Apache proxying to specific env config
Browse files Browse the repository at this point in the history
This change limits when Apache will proxy pass to the application to when the CFGOV_APPLICATION_HOST env var is set.
  • Loading branch information
willbarton committed Dec 9, 2024
1 parent 8cfb26e commit 25e274c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cfgov/apache/conf.d/proxy.conf
Original file line number Diff line number Diff line change
@@ -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/
4 changes: 4 additions & 0 deletions cfgov/apache/conf.d/wsgi.conf.venv
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 25e274c

Please sign in to comment.