Redirection to projects via different ports
-
Hello Guys! I usually google things as long as it's needed to find a solution, but this time I failed. That's why I decided to ask for you help. To the business:
- I have Laragon installed on Windows machine
- Two project in in it (Laravel and Lumen)
- Both working perfectly fine on local env
- What I am struggling to do is having remote access to both of them, working like this:
a) connecting to public IP of home network via port 8087 - opening project 1
b) connecting to public IP of home network via port 8089 - opening project 2
Both ports are redirected on router to equivalent ports on local machine which is host for Laragon.
What I've done is setting both ports to be listened in httpd.conf. Then I tried with virtual host settings, but without any success. No matter what I do, all traffic is redirected to project 1 only.
Could you point out what I am doing wrong and how to approcach this correctly? Many thanks!
-
Have you tried
ngrok sharing feature
of Laragon?
Just clickshare > project
and your project is shared to public - no need to conf
igure your router and Virtual Hosts
-
No I have not, is it secure solution?
-
Yes @tomatow : It is extremely secure - more secure than your first solution as data are transferred through https on private tunnels.
You should try it - just 2 clicks for your projects
-
@leokhoa Thank you! I've tried that, but as it happens, there is error:
ERR_TOO_MANY_REDIRECTS
-
Hmm, you can try another simple project to know how Ngrok works.
I believe there are some settings in your code should be updated when using Ngrok.
-
@leokhoa OK, I've tried that. Made completely new project, then copy&paste content of old one. Now it works! Is it possible to set up paid Ngrok account via Laragon menu or I just need to dive into console? This project will be used as API, so I am not sure if 40 request per minute is enough.
However I am quite curious why it failed with previously created projects.
Console log says that request is being redirected (301) many times. I need to check where and why, any clues?