Redirection to projects via different ports


  • | 388 points

    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:

    1. I have Laragon installed on Windows machine
    2. Two project in in it (Laravel and Lumen)
    3. Both working perfectly fine on local env
    4. 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!


  • administrators
    | 66720 points

    Have you tried ngrok sharing feature of Laragon?
    Just click share > project and your project is shared to public - no need to conf
    igure your router and Virtual Hosts


  • | 388 points

    No I have not, is it secure solution?


  • administrators
    | 66720 points

    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 :)


  • | 388 points

    @leokhoa Thank you! I've tried that, but as it happens, there is error:
    ERR_TOO_MANY_REDIRECTS :(


  • administrators
    | 66720 points

    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.


  • | 388 points

    @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?


Log in to reply
 

Looks like your connection to Laragon was lost, please wait while we try to reconnect.