Skip to content

Instantly share code, notes, and snippets.

@petertoi
Last active August 29, 2015 14:21
Show Gist options
  • Save petertoi/20ae563e5fa6ad523269 to your computer and use it in GitHub Desktop.
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
# 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