Hey. I paid, so I feel okay about asking what may be a stupid question. :)
Okay, so I am developing a Rails application locally. It uses custom subdomains. So when I start my rails server and visit foo.myapp.dev:3000 I see the correct view for the foo account.
So now I want to use ngrok so I can see this in Virtual Box (yep, I'm doing IE layout fixes), but I'm not sure how to do it.
I tried this:
~/Sites/ngrok foo.myapp.dev:3000
which starts ngrok fine, but no dice.
Can anybody point me in the right direction?
Thanks
ngrok doesn't modify any traffic passing over the tunnel. Including the Host header that some web servers use for routing you to the right site.
I'm guessing you're using Pow if you're doing rails, in which case this will probably be helpful:
http://journal.wearebunker.com/post/59684890589/using-ngrok-with-pow-for-development-previews
If not, ngrok's FAQ has instruction on how to make this work with Apache or Nginx:
https://ngrok.com/faq
Just to be more clear, development servers relying on the Host header will be looking for requests that have a Host header like:
GET / HTTP/1.1
Host: foo.myapp.dev
Instead it's getting:
GET / HTTP/1.1
Host: 3c9af0e.ngrok.com
Future versions of ngrok will automatically rewrite the Header for you.
Not using Pow.
Just have 127.0.0.1 foo.myapp.dev in /etc/hosts
I seem to have figured it out. Just used a custom subdomain in ngrok, and my application has picked it up. So in my example case ~/Sites/ngrok -subdomain foo 3000 has done the trick.
Thanks for the lightning quick response though. :+1:
For unpaid users:
ngrok http -host-header=rewrite [your-custom-local-domain]:[port]
Unpaid users and others can use this gist as well
nice! Thanks
For unpaid users:
ngrok http -host-header=rewrite [your-custom-local-domain]:[port]
Thank you! :+1:
Most helpful comment
For unpaid users:
ngrok http -host-header=rewrite [your-custom-local-domain]:[port]