Last active
August 29, 2015 14:21
-
-
Save petertoi/20ae563e5fa6ad523269 to your computer and use it in GitHub Desktop.
nginx snippet for redirecting local VVV WPMU dev site /files to another domain
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
# Be sure to comment out the /files rules in /vagrant/config/nginx-config/nginx-wp-common.conf | |
# then add this to the bottom of the your /vagrant/config/nginx-config/sites/domain.conf | |
# replace 'domain' with the domain associated with your project | |
if ($http_host ~ (.*)\.domain\.dev) { | |
set $subdomain $1; | |
} | |
location ~ ^/files/(.*) { | |
rewrite ^/files/(.*)$ http://$subdomain.domain.com/files/$1 redirect; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment