Replies: 1 comment 1 reply
-
Use an absolute URL in the res.redirect() function: Instead of using metadata.url, try using the complete URL, like this: res.redirect('https://www.google.com');. Add a trailing slash to the redirect URL: Try using res.redirect(metadata.url + '/'); to ensure the URL is properly formatted. Check IIS configuration: Verify that IIS allows redirections and doesn't have any rules that might interfere with the Node app's redirect behavior. Networking or Firewall Issues: There could be networking or firewall configurations affecting the communication between the Node.js app and IIS, causing unexpected responses. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a node app using express as the server. I cannot get redirects to work. First it is running as a service on a Windows server and it is hosted in IIS as a pass-through site. All the endpoints work except when I attempt a redirect.
So if I use: res.send(metadata.url); I receive a valid URL. If I copy it into my browser it works.
in the body.But if I use: res.redirect(metadata.url); I receive an odd error page with
I've tested many things including just redirecting to a static site.
So if use: res.redirect(https://www.google.com); I don't end up at google but rather the index.html page of my service is returned.
Does anyone have any ideas at all what I might try? Thanks.
Beta Was this translation helpful? Give feedback.
All reactions