I have virtual hosting server running OpenLiteSpeed via CyberPanel on my local machine in Windows 11 WSL2 for web developing. I'm accessing multiple websites using local domains, such as testsite1.priv, instead of localhost/testsite1 or 127.0.0.1/testsite1. The localhost mappings are done in WSL2 Ubuntu etc/hosts and Windows c:\windows\system32\drivers\etc\hosts files like that:
127.0.0.1 testsite1.priv
127.0.0.1 testsite2.priv
I use 80 port for listening in OpenLiteSpeed server. So I just enter testsite1.priv in Chrome and local site works fine in Windows.
But how to make site accessible to public from my local machine using ngrok or pagekite? What command line has to be for ngrok or pagekite? I tried commands:
ngrok http http://testsite1.priv:80
or
ngrok http http://testsite1.priv
or
ngrok http testsite1.priv
Following ngrok generated link I get html footer from OpenLiteSpeed server, but page content is:
404
Not Found
The resource requested could not be found on this server!
P.S. I'm new to hosting and tunneling software. Trying to figure out the most convenient workflow for me. And I'm not stuck to only ngrok and pagekite, just these are most popular now.
Thanks for any help! Don't say that's impossible :D
Solution! Ok. I finally googled the answer. The ngrok command has to be for me:
ngrok http -host-header=rewrite testsite1.priv:80
For PageKite:
pagekite.py 80 xxxxxx.pagekite.me +rewritehost=testsite1.priv
xxxxxx - your PageKite free subdomain