1
votes

I want to expose my in-development asp.net core web app so that I can demo it etc. I use ngrok to do this, but this doesn't seem to work with asp.net core. I get a 502 bad gateway error

I'm tunnelling with this command:

./ngrok tcp 5001

My web host builder code in program.cs sets up kestrel as follows:

.UseKestrel(options =>
{
    options.AddServerHeader = false;
    options.Listen(IPAddress.Loopback, 5000);
    options.Listen(IPAddress.Loopback, 5001, listenOptions =>
    {
        listenOptions.UseHttps("localhost.pfx", "SOMETHING");
    });
})

So I can hit my web app with localhost or my local IP address, but via ngrok it fails.

Does anyone know why this is?

1

1 Answers

0
votes

For Ngrok, you can try this command:

./ngrok http https://127.0.0.1:5001

You can also try a shorthand of ./ngrok http 5001, but sometimes that doesn't work for me.