We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前出现的问题,是在开发后端项目时,Express.js 中 res.redirect 如果要将用户重定向至其他域名下的网址会失败。
比如当前的后端项目在域名 a.com 下,res.redirect 要将用户重定向至 b.com/abc 这个 URL,但是在浏览器中最后的重定向结果,发现被重定向到了 a.com/abc,也就是重定向指令中的域名被改回后端项目所在域名了。
在 Express.js 中输出 res._header,确认 Location 的确是 b.com/abc,也就是后端程序部分是没有问题的,那问题很可能就出在 IIS 上。
res._header
于是 Google iis change http header location domain 这组关键词,果然在第一页的 Stack Overflow 链接中看到了解决方案:IIS reverse proxy interfering with redirect location header,原来是 IIS 中的 Application Request Routing(ARR)模块搞的鬼。
iis change http header location domain
现在要解决这个问题就很简单了,打开 IIS 管理器,点击当前服务器名称(就在“起始页”几个字下面),然后点击右侧的 Application Request Routing Cache → Server Proxy Settings,取消勾选“Reverse rewrite host in response headers”,OK,大功告成!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
具体流程
目前出现的问题,是在开发后端项目时,Express.js 中 res.redirect 如果要将用户重定向至其他域名下的网址会失败。
比如当前的后端项目在域名 a.com 下,res.redirect 要将用户重定向至 b.com/abc 这个 URL,但是在浏览器中最后的重定向结果,发现被重定向到了 a.com/abc,也就是重定向指令中的域名被改回后端项目所在域名了。
在 Express.js 中输出
res._header
,确认 Location 的确是 b.com/abc,也就是后端程序部分是没有问题的,那问题很可能就出在 IIS 上。于是 Google
iis change http header location domain
这组关键词,果然在第一页的 Stack Overflow 链接中看到了解决方案:IIS reverse proxy interfering with redirect location header,原来是 IIS 中的 Application Request Routing(ARR)模块搞的鬼。现在要解决这个问题就很简单了,打开 IIS 管理器,点击当前服务器名称(就在“起始页”几个字下面),然后点击右侧的 Application Request Routing Cache → Server Proxy Settings,取消勾选“Reverse rewrite host in response headers”,OK,大功告成!
The text was updated successfully, but these errors were encountered: