Using Laragon, I've created a WordPress site on my local machine for testing a plugin I'm developing. Laragon creates virtual hosts for projects and I can access my wordpress site locally at wp001.test, which is normal since my project is named wp001.
If I run ngrok like so I can browse my site externally using the dynamically generated ngrok domain:
ngrok http -host-header=rewrite wp001.test:80
I signed up for a pro ngrok account so I could use a reserved domain name. I created my reserved domain name on the ngrok dashboard.
Now I can get ngrok to accept my reserved domain like so:
ngrok http -hostname=my-reserved-domain.ngrok.io 80
Then I can browse to my-reserved-domain.ngrok.io
but it's taking me to the web root of the file system (C:\laragon\www
) instead of making use of the virtual host.
How can I make ngrok use my reserved domain with the virutal host? I've read the ngrok docs but I'm just not seeing it.
I was able to make this work by using an ngrok config file. The file looks like this:
Then starting ngrok and specifying the config file: