Ngrok errors '502 bad gateway'

前端 未结 15 1423
谎友^
谎友^ 2020-12-15 03:16

Quite new to using any sort of Web App stuff, and I\'ve been trying to slowly build a Facebook Messenger Bot. When I try to use ngrok I can\'t visit the address I\'m given,

相关标签:
15条回答
  • 2020-12-15 03:30

    This worked for me

    ngrok.exe http -host-header=rewrite localhost:

    e.g ngrok.exe http -host-header=rewrite localhost:5219

    Im using visual studio 2017 dont know if it effects anthing.

    0 讨论(0)
  • 2020-12-15 03:31

    If you just with to use ngrok to intercept incoming data, and you do not have a local webserver for whatever reason, then you can use ncat.

    nc -l 5000

    This will create a process that listens on port 80.

    So when used in combination with

    ngrok http 5000

    You will no longer get the '502 bad gateway' error.

    0 讨论(0)
  • 2020-12-15 03:31

    I had to put my server ip address and works perfect!

    ./ngrok http [ip server]:5000

    0 讨论(0)
  • 2020-12-15 03:33

    Step 1 - Register to ngrok and download .exe file in dashboard page

    Step 2 - Open terminal and copy & paste from the dashboard the line without ./

    Step 3 - run your localhost

    Step 4 - If step 2 was successfully done, paste in the same terminal (step 2) the line with your localhost port

    ngrok http https://localhost:44386 -host-header="localhost:44386"

    Step 5 - Copy the URL generated in the terminal and waalla.. you can ping to it.


    In case of <<<<Ngrok errors '502 bad gateway'>>>> change https into http so the Step 4 will be ngrok http http://localhost:44386 -host-header="localhost:44386"

    0 讨论(0)
  • 2020-12-15 03:36

    It seems that this issue has now been resolved in the latest version of ngrok: https://github.com/inconshreveable/ngrok/issues/448

    Basically, what you do is to specify that you are using https like this:

    ngrok http https://localhost:54321 -host-header="localhost:54321"
    

    At least, this resolved the issue for me. Replace 54321 with your actual port number.

    0 讨论(0)
  • 2020-12-15 03:36

    502 gateway error occurs because ngrok not able to receive any reponse from Localhost.

    The things need to be done is :

    1. Start a webserver in a Port
    2. Trigger ngrok command in that Port.

    What I have done is

    • Started a tomcat Web Server in 8080.
    • Then Triggered ngrok http 8080.

    It works really cool ...
    Try this .....
    Hope it works for You .

    0 讨论(0)
提交回复
热议问题