- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个带有 的 IIS10 服务器ARR 3.0 和 URL 重写模块 2.1 它充当其他几个 Web 服务器的反向代理。其他服务器在不同的端口上运行,因此 IIS10 服务器在端口 80 上提供“友好 URL”。URL 重写用于将请求传递给后端服务器。
一个这样的服务器是 Jenkins .
Jenkins 有一条警告消息告诉您反向代理是否配置正确(more details here),这条警告消息帮助我找到了反向代理中的问题。
问题是 URL 重写正在以某种方式对我的 URL 进行解码和编码,当它们到达 Jenkins 时,它们与浏览器请求的不同。
示例:
URL 重写规则:
<rule name="Jenkins Rewrite" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{HTTP_HOST}" pattern=".*jenkins.mydomain.*" />
<add input="{HTTPS}" pattern="on" />
</conditions>
<action type="Rewrite" url="http://localhost:8080/{R:1}" appendQueryString="true" />
<serverVariables>
<set name="HTTP_X_FORWARDED_HOST" value="{HTTP_HOST}" />
<set name="HTTP_X_FORWARDED_SCHEMA" value="https" />
<set name="HTTP_X_FORWARDED_PROTO" value="https" />
</serverVariables>
</rule>
/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https:/jenkins.mydomain/manage/
<action type="Rewrite" url="http://localhost:8080{UNENCODED_URL}" appendQueryString="false" />
/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https%253A%252F%252Fjenkins.mydomain%252Fmanage%253F
/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https%3A%2F%2Fjenkins.mydomain%2Fmanage%3F
/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/<parameter1>
<parameter1> = https%3A%2F%2Fjenkins.mydomain%2Fmanage%3F
<parameter1>
中的斜线字符被编码以便 Jenkins 可以知道
path
的一部分是什么什么是
<parameter1>
.
<parameter1>
与
path
的其余部分混在一起.
http://localhost:8080/administrativeMonitor/hudson.diagnosis.ReverseProxySetupMonitor/testForReverseProxySetup/https%3A%2F%2Fjenkins.mydomain%2Fmanage%3F
In URL Rewrite versions prior to v7.1.1980, when one tries to use UNENCODED_URL, URL Rewrite will encode it which may lead to double encoding if the original URL was already encoded This is in violation of section 2.4 of RFC3986, which says "Implementations must not percent-encode or decode the same string more than once, as decoding an already decoded string might lead to misinterpreting a percent data octet as the beginning of a percent-encoding, or vice versa in the case of percent-encoding an already percent-encoded string." It also made the use of UNENCODED_URL impractical, especially in reverse forwarder scenarios with ARR where the backend servers expect the URL to be passed unmodified.
In v7.1.1980, we are adding a feature flag, useOriginalURLEncoding that allows you to turn off this non-compliant URL Encoding when set to true. The default behavior will remain unchanged (useOriginalURLEncoding is true by default).
最佳答案
我设法解决了这个问题,通过设置 useOriginalURLEncoding = false
在我在问题中引用的帖子中进行了描述。
设置标志去IIS Manager
然后选择Configuration Editor
并转到 system.webServer/rewrite/rules
部分,您将在其中找到 useOriginalURLEncoding
旗帜。
将该标志设置为 false,当使用 {UNENCODED_URL}
时,URL 重写将不再对 URL 进行编码。规则中的变量。
关于IIS10 URL Rewrite 2.1 双编码问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47146029/
我有一个使用moodle库的项目。由于客户端请求,我不得不将 URL 从moodle.example.com 更改为learn.example.com。 我认为这将是一个简单的更改,但唉,moodle
目前,在我的生产服务器上,我设置了如下的入站规则,它可以满足我的所有要求。 入站规则如下。 Match URL section Requested URL: Matches the Pattern U
我正在 Heroku cedar 堆栈上运行一个 PHP 应用程序。有没有办法设置 URL 重写规则?我曾希望在 .htaccess 文件中执行此操作,但在此只能识别访问控制指令。 我看到 Ruby
我正在尝试在运行 CentOS 6.4 和 NginX 1.8 的 VPS 上设置 Laravel 框架。我可以让其他一切都完美地工作,除了我无法让更清晰的 URL 工作,比如使用“website.c
我刚刚从 IIS6 svr2003 迁移到 IIS7.5 服务器 2008r2 并安装了 url 重写。这一切都很好。有问题的网站很大,并且在 .net 2 集成管道下运行。目前无法在 .net 4
首先是一些无聊的进口: import Relation.Binary.PropositionalEquality as PE import Relation.Binary.HeterogeneousE
我正在 IIS 6 上构建一个 Drupal CMS 网站,并使用 ISAPI Rewrite 3 来提高 url 的可读性。我的问题是我有一个位于 Drupal 站点内的虚拟目录,但它指向 Drup
每个网络应用程序/上下文有没有办法为该特定网络应用程序指定重写文件?我看到当前工作的唯一方法是在您启动它时通过命令行。我在想可能是 override.xml 文件中的设置,甚至是上下文 xml 文件中
我想为基于 Struts2 的应用程序(目前在开发环境中)重写 URL。我搜索了它并找到了 Tuckey URL Rewrite 并在我的项目中进行了设置。现在我希望我的登录 url 当前为 http
我正在尝试使用 IIS URL Rewrite 2.0在 Windows 8.1 上使用 IIS 8.5。根据 Accessing URL Parts from a Rewrite Rule , Fo
我们有以下重写规则: RewriteRule ^([A-Za-z0-9\_]+)$ index.php?rewrite=$1 [L,QSA] 我们想知道是否有一种方法可以让 ?rewrite=$1
我们有以下重写规则: RewriteRule ^([A-Za-z0-9\_]+)$ index.php?rewrite=$1 [L,QSA] 我们想知道是否有一种方法可以让 ?rewrite=$1
我从 Web 平台安装程序安装 URL Rewrite。没有添加规则。然后,当我访问网站 url 时,它返回 503 代码并且应用程序池已停止。当我从控制面板中卸载 URL 重写模块时,它工作正常。
假设我在 example.com 上托管了一个站点,现在我希望我的每个注册用户都获得一个个性化的子域,例如 Alice 通常应该将 alice.example.com 作为她的子域。而实际上 alic
我正在按照Jetty文档示例在嵌入式Jetty服务器中实现一个简单的重写规则。 我想将对/admin/的请求重写为/admin.html。 目前,如果我请求/admin/,则会收到404错误,找不到/
我有这个重写规则 RewriteEngine On RewriteBase /location/ RewriteRule ^(.+)/?$ index.php?franchise=$1 假设要更改此
Closed. This question is off-topic。它当前不接受答案。 想改善这个问题吗? Update the question,所以它是on-topic,用于堆栈溢出。 7年前关
我有两个 apache 服务器都具有相同的设置,我克隆了 apache 配置文件,并且只更改了 ServerName 部分。当我键入 mysite.com/somestuff 它应该重写为 index
我想即时创建文件夹,但让我看起来像是在使用 mod_rewrite 即时创建子域。例如 使用 PHP 创建“john”文件夹 www.example.com/john/ 然后能够访问我放在那里的任何内
如何删除main/中的http://domain/main/about 因此该网址将类似于http://domain/about 谢谢 最佳答案 好吧,在没有更多详细信息的情况下,您可以尝试执行以下操
我是一名优秀的程序员,十分优秀!