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>
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.
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
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With