【问题标题】:reverse proxy on iis to hide part of URIiis 上的反向代理以隐藏部分 URI
【发布时间】:2018-01-22 09:36:45
【问题描述】:

我正在尝试为网站实现代理 我有:

http://localsite/site1

http://localsite/site2

http://localsite/site3

我正在尝试创建一个将http://localsite/site1 显示为http://globalsite1 的代理 http://localsite/site2http://globalsite2

我在添加 ARR 和 URL 重写时发现了 IIS 反向代理功能。

问题是当我创建这样的东西时:http://globalsite1 指向 http://localsite 一切正常 但是当我将http://globalsite1 指向http://localsite/site1 时,大多数图片都会停止工作。 找到http://localsite/moduls下的图片

如何创建一个规则来代理和隐藏 /site1 扩展但保持图片不变

希望我清楚

谢谢!

【问题讨论】:

    标签: iis web proxy url-rewriting arr


    【解决方案1】:

    在指定图像源时检查代码是否使用相对路径。如果是,您必须编写出站规则来重写图像文件请求。使用以下规则作为参考:

    <outboundRules>
      <rule name="RewriteImages">
        <match filterByTags="Img" pattern="(.*).jpg$" />
        <action type="Rewrite" value="http://localhost/moduls/{R:0}" />
      </rule>
    </outboundRules>
    

    【讨论】:

      猜你喜欢
      • 2018-02-22
      • 2019-09-12
      • 2013-09-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-12
      相关资源
      最近更新 更多