ngrok can be used to provide access to a local homestead or vagrant site remotely i.e. to a client.
You need to use header rewriting to work with the homestead configuration, the syntax for using a single site looks like:
ngrok http -host-header=rewrite mysite.app:80
If you have multiple sites then you will need to use ngrok with a config file, stored in ~/.ngrox.config.yml
. The docs are vague on how to do the rewriting in the config file so here it is for reference:
tunnels: mysite: addr: mysite.app:80 proto: http host_header: rewrite myapi: addr: myapi.app:80 proto: http host_header: rewrite
Note that host header rewriting doesn’t work nicely with cookies which seriously limits this.
Hey,
Thanks for your post.
Currently struggling into an issue with that kind of configuration. I can access my vhost through ngrok, however I can’t initiate sessions.
It looks like cookies sessions can’t be set, do you know if the rewrite option of ngrok also rewrite the cookie domain ?
Do you successfully initiate sessions or log into applications with ngrok ?
Thanks