ngrok 502 bad getaway

Hello, after I set up the connection of ngrok, when I check whether it is successful through the curl command, it shows 502 bad getaway, which shows that the tunnel is connected, but the web service is not started. How can I solve it, please give me Detailed steps, thank you

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi there,

When running the ngrok command you would need to specify the same port that you’ve used for your backend application. For example, if you are running a Node.js application on port 3000, then you would have to run ngrok http 3000.

You would get a 502 error in case that the ports do not match or in case that your backend application is not running at all.

Can you share the exact ngrok command that you are running and the output that you get when you run the command?

Regards, Bobby