Created
September 2, 2021 07:13
-
-
Save TomCan/b47257c8aa82389c1b3627490f61fa51 to your computer and use it in GitHub Desktop.
Apache reverse proxy with content rewrite
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
# | |
# use case: Reverse proxy for system that returns fully-qualified URLS in the content (eg. wsdl file) | |
# | |
# Requires: mod_proxy, mod_proxy_http and mod_substitute | |
# | |
ProxyPass / http://backend-server/Some/API/On/Some/Path/ | |
ProxyPassReverse / http://backend-server/Some/API/On/Some/Path/ | |
# Rewrite URLs in wsdl | |
# uses | as delimiter since / is in the pattern | |
# "n" flag as this is not a regular expression | |
# "i" flag for case insensitive match | |
# "q" flag to not flatten as we're not doing any other substitutions | |
Substitute "s|http://backend-server/Some/API/On/Some/Path/|https://my.proxy.hostname/|niq" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment