NGKK and Laravel
I want to deploy my local larvel site online with NGROK. I am using Laragon with Apache server, I am using this command:
ngrok http -host-header=rewrite site.dev:80
It almost works, but the asset file (like CSS / Image) still links to my local server (site.dev). And it is the same for my link, laravel routing command:
{{ route('ngo') }}
return site.dev/ngo instead of my online tunnel ( http://number.ngrok.io/ngo )
I have tried:
Edit the http.conf ( https://forum.laragon.org/topic/88/allow-outside-other-devices-phones-tablets-to-access-your-local-server-using-ngrok )
Change my Laravel app url in config / app.php
Change my url in .env file
Working with notes
source to share
I ran into this problem myself now, but found a way to fix it:
Run ngrok without the part -host-header=rewrite
, resulting in
ngrok http site.dev:80
After that, edit the http.conf file and add the ngrok domain as the server alias.
The problem is that the Laravel helper is route
using a header HOST
that rewrites to site.dev
. Without the part, the -host-header
title is not rewritten and now it works.
source to share