Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

targeting dev sites with vhost setup using ngrok

I'm trying to tunnel a clients site in my sites directory with "ngrok http -host-header = client1.dev 80", I get a 404 when accessing the url. After some experimenting, if I put an index.html file in the home directory, it will display that file. Not sure why a file in the home directory works while files in sites directory do not. I must be missing something 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> 
like image 845
paul degrand Avatar asked Jul 26 '15 00:07

paul degrand


People also ask

How do I use TCP in Ngrok?

To do this, first, log in to your ngrok.com dashboard and click "Reserve Address" in the "Reserved TCP Addresses" section. Then use the --remote-addr option when invoking ngrok to bind a tunnel on your reserved TCP address. Make sure the --region you specify matches the region in which you reserved your address.


2 Answers

Cool All your config is good, You just have to exec command

ngrok http -host-header=rewrite home.dev:80  ngrok http -host-header=rewrite sites.dev:80 
like image 108
Abdourahmane FALL Avatar answered Sep 21 '22 01:09

Abdourahmane FALL


For me it only worked with:

ngrok http -host-header=sites.dev 80 

Change sites.dev to you virtual host name

Source: Virtual hosts (MAMP, WAMP, etc)

like image 29
Diogo Gomes Avatar answered Sep 24 '22 01:09

Diogo Gomes