简体   繁体   English

IIS URL将子文件夹重写为其他URL

[英]IIS URL rewrite subfolder to other url

I have a website running on a load balanced environment using 2 Azure servers. 我有一个使用2个Azure服务器在负载平衡环境中运行的网站。 I have two end points which allow me to connect to each server separately 我有两个端点,可以分别连接到每个服务器

eg 例如

  • www.url.com:801 - goes to server 1 www.url.com:801-转到服务器1
  • www.url.com:802 - goes to server 2 www.url.com:802-转到服务器2

Website uses CKFinder for uploading files to the server, via www.url.com/ckfinder. 网站使用CKFinder通过www.url.com/ckfinder将文件上传到服务器。

This of course creates a problem as when user opens www.url.com/ckfinder the response can come from the server 1 or the server 2 and of course uploaded file is going to be stored only on server 1 or server 2 这当然会产生问题,因为当用户打开www.url.com/ckfinder时,响应可能来自服务器1或服务器2,并且上载的文件当然将仅存储在服务器1或服务器2上

Is it possible to create an IIS url rewrite rule on the server 1 which will every request to the specific URL redirect to other URL 是否可以在服务器1上创建IIS URL重写规则,该规则将每个对特定URL的请求重定向到其他URL

Example

User calls www.url.com/ckfinder, LB redirects the request to the server 2 - server 2 serves the request 用户调用www.url.com/ckfinder,LB将请求重定向到服务器2-服务器2为请求提供服务

User calls again www.url.com/ckfinder, this time LB redirects request to the server 1, IIS on the server1 redirects user to www.url.com:802/ckfinder 用户再次调用www.url.com/ckfinder,这次LB将请求重定向到服务器1,server1上的IIS将用户重定向到www.url.com:802/ckfinder

thanks! 谢谢!

You can configure HTTP Redirection on IIS. 您可以在IIS上配置HTTP重定向。 Type in google how to configure http request on IIS and you will find plenty of helpful websites. 输入google如何在IIS上配置http请求,您会发现很多有用的网站。

In order to do this. 为此。 Enable HTTP Redirection feature under Common HTTP Features (Use this Link for step by step guide 在“通用HTTP功能”下启用HTTP重定向功能(使用此链接的逐步指南

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

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