-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Limit Apache proxying to specific env config
This change limits when Apache will proxy pass to the application to when the CFGOV_APPLICATION_HOST env var is set.
- Loading branch information
1 parent
8cfb26e
commit 1633e57
Showing
3 changed files
with
15 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters