Okta hosted login + nginx proxy manager

Hello, we are having some troubles to configure our nginx proxy manager to correctly redirect and get okta hosted login workiing.
We are using dot net okta sdk sample samples-aspnetcore/samples-aspnetcore-3x/okta-hosted-login/okta-aspnetcore-mvc-example at master · okta/samples-aspnetcore · GitHub

Apparently we are getting the challange part ok, but after that the auth/callback redirection fails with a Bad Gateway message. We are pretty sure it is some cookies handle misconfiguration between nginx proxy manager and the IIS.

We have the application hosted in a IIS using http, and the reverse proxy handling everything as https, not sure if that could give us some trouble too.

It works great in localhost, and works ok in the server without the reverse proxy, so we thing it has something to do with the reverse proxy and our Program.cs configuration, but we are not getting the right combination to get it up and running.

Any hel would be greatly apreciatted

Hi,

Can you try using one of our newer AspNet Samples, also it might be worth taking a look into the Proxy Configurations to check if that solves your issue.

Hello, thanks for your reply!

We tried with the last sample using .net core 7 from this url too.
Just like with our app, it works great on localhost, but Bad Gateway in our server.

I think we don’t need Proxy Server configuration, because we are just using Nginx Proxy Manager just as reverse proxy (to forward every request internally).

I’m pretty sure it has something to do with cookies or headers we are missing, do you have any guide on how to configure okta hosted login in Reverse Proxy scenarios?

Tanks in advance!

Leo