Skip to content

Instantly share code, notes, and snippets.

@parthghiya
Created November 5, 2017 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save parthghiya/a6935f65a262b1d4d0c8ac24149ce61d to your computer and use it in GitHub Desktop.
Save parthghiya/a6935f65a262b1d4d0c8ac24149ce61d to your computer and use it in GitHub Desktop.
Sample Apache Configuration for Redirections to migrated or existing application based on rules
RewriteEngine On
# Serve feature from new service for internal network
RewriteCond expr "%{HTTP:X-FORWARDED-FOR} -ipmatch '171.78.205.170/24'"
RewriteRule ^/feature/(.*)$ ${NEW_SERVICE_URL}/$1 [P,L]
# Proxy everything else to legacy application
RewriteRule ^/(.*) ${LEGACY_URL}/$1 [P]
ProxyPassReverse / ${LEGACY_URL}/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment