Trying to make Laravel Valet work with Ngrok serving a local WordPress site for other pcs and phones not part of the network.
Issues: Many things written down here at Stack Overflow. Seems DNS cannot be resolved. Caddy serves all files correctly and does not show any server errors related to the issue. Ngrok keeps on mentioning redirects. Browsers say either connection is refused or DNS cannot be resolved.
Redirect mention;
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=UTF-8
Location: http://rocketpure.localhost/
Server: Caddy
Status: 301 Moved Permanently
X-Powered-By: PHP/7.0.11
X-Ua-Compatible: IE=edge
Date: Mon, 03 Oct 2016 11:22:54 GMT
Content-Length: 0
Going really crazy here and need it up or move to another option. Decided to post here as Valet uses Caddy and Ngrok. Asked Ngrok for help, but no response yet. At SO no answers yet either. Could be totally an Ngrok issue, but would like to make sure the Caddy Setup is OK and son. Appreciate the feedback!
Looks like your PHP app expects your hostname to be rocketpure.localhost instead of whatever ngrok is tunneling it through (the xxxxx.ngrok.io thing, which is where clients are actually making their requests… I presume). It sees a different hostname so it’s redirecting to a host that can’t be reached through ngrok.
So this doesn’t appear to be an issue with Caddy, but I hope you figure it out soon!
Yeah, well it does hit my Mac Mini and shows these headers in the NGrok control panel at localhost:4040. The PHP script tells Ngrok the site is at site.localhost:80 and run that as a header rewrite:
Also wondered whether it was ipv4/6 related, but in the logs you see regular localhost and ::1 being loaded just fine. No redirects this way as you can see. So it either is the script dealing with the conversion of the Ngrok domain to a local domain or Ngrok itself. Opened a thread with Valet as well and asked Ngrok for some advice. Gut feeling says it is a Laravel Valet thing. Opened an issue there so we shall see. Will keep you guys updated.