Target developer sites with vhost configuration using ngrok

I am trying to tunnel a clients site in my sites directory using "ngrok http -host-header = client1.dev 80", I get 404 when accessing the url. After some experimentation, if I put the index.html file in my home directory, it will display that file. You do not know why the file in the home directory works, but the files in the site directory do not. I must have something missing here. Any ideas?

Directory structure

:

www |home |sites | client1 | client2 ... 

vhost.conf:

 <Directory "/www"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Virtualhost *:80> VirtualDocumentRoot "/Users/myname/www/home/wwwroot" ServerName home.dev UseCanonicalName Off </Virtualhost> <Virtualhost *:80> VirtualDocumentRoot "/Users/myname/www/sites/%1/wwwroot" ServerName sites.dev ServerAlias *.dev UseCanonicalName Off </Virtualhost> 
+6
source share
3 answers

Cool All your settings are good, you just need to execute the exec command

 ngrok http -host-header=rewrite home.dev:80 ngrok http -host-header=rewrite sites.dev:80 
+23
source

For me, he only worked with:

 ngrok http -host-header=sites.dev 80 

Change sites.dev to virtual host name

Source: https://ngrok.com/faq#virtual-hosts

+5
source

Your configuration is correct. Now you just need to configure ngrok to return your virtual host

 ngrok http -host-header=rewrite home.dev:80 ngrok http -host-header=rewrite sites.dev:80 

Good luck.

0
source

All Articles