简体   繁体   English

IIS处理请求到其他服务器的传输(不重写URL)

[英]IIS to handle request transfer to other server (without url rewrite)

I want my website to serve static contents by different server and if possible even javascripts files as well from another server. 我希望我的网站可以由其他服务器提供静态内容,如果可能的话,甚至还可以从另一台服务器提供javascripts文件。 I know it can be achieved using url rewrites but it gives 301 errors (ie extra round trip to browser). 我知道可以使用url重写来实现,但是会出现301错误(即,浏览器额外往返)。 I asked similar question here but did not get any satisfactory response as it seems my question was not correct. 在这里提出了类似的问题但由于我的问题似乎不正确,因此未得到满意的答复。

Can some one suggest how to achieve this without extra round trip to browser? 有人可以建议如何实现这一目标而无需额外的浏览器往返吗? I have seen other teams achieving this in Apache server but not able to find how to do it in IIS. 我已经看到其他团队在Apache服务器中实现了这一目标,但是找不到在IIS中的实现方式。

Have you tried "Rewrite" instead of "Redirect"? 您是否尝试过“重写”而不是“重定向”? These are at least two viable options of rewriting where Redirect means 301/302 and rewrite operates silently at the server. 这些是至少两个可行的重写选项,其中重定向表示301/302,并且重写在服务器上以静默方式运行。

From your other question, it seems that you tried with "Redirect", this explains the 301. Change Redirect to Rewrite then. 从另一个问题来看,似乎您尝试使用“重定向”,这说明了301。然后将“重定向”更改为“重写”。

The only important thing is that if you want your rewrites act between different servers, you will need the ARR (Application Request Routing) installed on a front-end server. 唯一重要的是,如果希望您的重写在不同的服务器之间进行,则需要在前端服务器上安装ARR(应用程序请求路由)。 While URL Rewrite handles only local rewrites, ARR can act as a transparent proxy to other servers. URL重写仅处理本地重写,而ARR可以充当其他服务器的透明代理。

ARR is a free add-on to IIS ARR是IIS的免费附件

http://www.iis.net/downloads/microsoft/application-request-routing http://www.iis.net/downloads/microsoft/application-request-routing

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM