Skip to content

Instantly share code, notes, and snippets.

@tsertkov
Created September 9, 2013 12:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tsertkov/6494833 to your computer and use it in GitHub Desktop.
Save tsertkov/6494833 to your computer and use it in GitHub Desktop.
Example of using Apache mod_ext_filter to replacing urls in proxied data (phpundercontrol).
<VirtualHost *:80>
ServerName phpuc.dev.example.com
# NB! It must be slow :-)
ExtFilterDefine fixurls mode=output intype=text/html \
cmd="/bin/sed \
-e s/http:\\/\\/localhost:/http:\\/\\/phpuc.dev.example.com:/g \
-e s/\\/phpundercontrol\\//\\//g \
-e s/\\/cruisecontrol\\/artifacts\\//\\/artifacts\\//g \
-e s/\\/cruisecontrol\\/logs\\//\\/logs\\//g \
"
SetOutputFilter fixurls
ProxyPass / http://localhost:8080/phpundercontrol/
ProxyPassReverse / http://localhost:8080/phpundercontrol/
</VirtualHost>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment