- vagrant up
- choose the network interface connected to internet
- vagrant ssh
- find ip address with
ifconfig
- go to `http://sitename.xxx.xxx.xxx.xxx.xip.io
Last active
October 5, 2015 20:33
-
-
Save jubstuff/4cc9eff7fa919af9a21b to your computer and use it in GitHub Desktop.
Setup xip.io in VVV
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
server { | |
listen 80; | |
listen 443 ssl; | |
server_name sitename.dev www.sitename.dev ~^sitename\.\d+\.\d+\.\d+\.\d+\.xip\.io$; | |
root /srv/www/sitename/htdocs/; | |
include /etc/nginx/nginx-wp-common.conf; | |
} |
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
# .... | |
config.vm.network :public_network | |
# ..... |
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
<?php | |
// .... | |
// Match any requests made via xip.io. | |
if ( isset( $_SERVER['HTTP_HOST'] ) && preg_match('/^(sitename.)\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(.xip.io)\z/', $_SERVER['HTTP_HOST'] ) ) { | |
define( 'WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] ); | |
define( 'WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] ); | |
} | |
// .... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment