ngrok loads document root instead of shared site #376
-
I created a ngrok account and added the authtoken to Laragon. I shared a site in Laragon > www > Share. When I load the URL, it shows the Laragon screen - the equivalent of localhost. How can I make it show a specific site? |
Beta Was this translation helpful? Give feedback.
Replies: 15 comments 21 replies
-
Are you on the latest Laragon 6? You should see the project from the list. Your project needs to be a child of Laragon's www directory. |
Beta Was this translation helpful? Give feedback.
-
Yes, I am on Laragon 6. I go to www > Share > and select the project. The ngrok window opens and shows a URL being mapped to that project. When I open the ngrok URL, it shows the Laragon (localhost) screen. |
Beta Was this translation helpful? Give feedback.
-
Yes, I'm getting the same localhost page that says "Getting Started". I'm on Laragon 6. |
Beta Was this translation helpful? Give feedback.
-
I'm getting same error, and when I check the config localhost on C:\laragon\bin\ngrok\conf |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
I created a shares folder in the laragon folder. In this folder I have bat files that I use to start ngrok. Content of example bat file: Replace ************* with your autoh token. |
Beta Was this translation helpful? Give feedback.
-
I'm using Laragon v6 and here's what I did is change the project config in sites-enabled: # Asumming your project name is 'project-name'
# Example path: C:\laragon\etc\apache2\sites-enabled\auto.project-name.test.conf
<VirtualHost project-name.test:80> # changing the wildcard '*' to 'project-name.test'
DocumentRoot "C:/laragon/www/project-name/public"
ServerName project-name.test
ServerAlias *.project-name.test
<Directory "C:/laragon/www/project-name/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost> Also, if your project is built using Laravel and encounred a problem that involves not loading the assets, then this might help you. Set your trust proxy to '*': # Path: <project root>/app/Http/Middleware/TrustProxies.php
class TrustProxies extends Middleware
{
// ...
protected $proxies = '*';
// ...
} |
Beta Was this translation helpful? Give feedback.
-
Will this be fixed in Laragon? |
Beta Was this translation helpful? Give feedback.
-
try manual terminal ngrok http localdomain.test:port |
Beta Was this translation helpful? Give feedback.
-
@leokhoa Please!!!! this needs to be fixed ASAP!!! !!! NO NOT USE THIS UNTIL IT'S FIXED !!! |
Beta Was this translation helpful? Give feedback.
-
I just installed a clean laravel app and shared with ngrok |
Beta Was this translation helpful? Give feedback.
-
This wasn't happening on laragon 5.1. Installed 6.0 a few weeks ago, noticing that in \bin\ngrok\conf my custom configurations get overwritten every time i try to share that site. Pretty much have to use ngrok manually for this reason. Can anyone confirm this behavior? |
Beta Was this translation helpful? Give feedback.
-
I found a quick solution to overcome this issue because a few weeks ago, my team also encountered a similar problem. Run the terminal in Laragon (terminal button) and execute the following command to set manually your key auth from ngrok: Then try running this command to run ngrok according to the local host in the www folder in Laragon: if the host-header doesn't work, try to type the command above manually Cherrs 🍻 |
Beta Was this translation helpful? Give feedback.
-
None of the above fix this issue for me. When using Laragon to share i get shown the root folder that contains all of my projects. I set C:\Users\Reinier\projects as the Documen Root in Laragon preferences. Anyone have an idea how to get rid of the redirect to the foldername.test and remain at the https://xx-xxx.ngrok-free.app address so i can view the website? |
Beta Was this translation helpful? Give feedback.
I found a quick solution to overcome this issue because a few weeks ago, my team also encountered a similar problem.
Run the terminal in Laragon (terminal button) and execute the following command to set manually your key auth from ngrok:
ngrok config add-authtoken your_token
Then try running this command to run ngrok according to the local host in the www folder in Laragon:
ngrok http --host-header=foldername.test 80
if the host-header doesn't work, try to type the command above manually
Cherrs 🍻