Using ngrok to access multiple homestead sites remotely

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

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:

        proto: http
        host_header: rewrite
        proto: http
        host_header: rewrite

Note that host header rewriting doesn’t work nicely with cookies which seriously limits this.


One Reply to “Using ngrok to access multiple homestead sites remotely”

  1. 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 ?


Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.