Redirection to okta login page works only on localhost

Hello everybody,

I’m using node.js/Express as back end, the oidc-middleware. The okta login page works great in localhost, but in production there is a bad redirection somewhere and I can’t fix it.

The Okta login web page doesn’t show off and I have this error “Cannot GET /oauth2/default/v1/authorize” (which means that I don’t have this route on my node.js/Express server so it’s normal)
When this error message occurs, if I replace manually the url of my website by the one of my okta domain, everything works perfectly.

Node.js/Express code :

Okta configuration :

I’m stuck on this for hours, please help me

you need to change the initiate login URI to {{website}}

Thank you for the answer.
But it still doesn’t work after the correction

Have you added your website url as a secure domain in okta?

I haven’t done anything like this. How can I do it ?

Is it this ?

I figured it out !

I used IIS as reverse proxy to deploy my node.js app. It used ‘URL Rewrite’ so it modified the URL.

I used iisnode to solve the problem.