1

全部 -

在反向代理上,我试图自动将查询字符串 arg 附加到传入 URI 的末尾,而 mod-rewrite 似乎在做一些奇怪的事情。

如果我使用这样的规则:

RewriteEngine On    # Turn on the rewriting engine
RewriteRule    /t/SkunkWorks/views/LabelLocalization/Dashboard$    /t/SkunkWorks/views/LabelLocalization/Dashboard\?Language=3  [L,PT]
#####Proxy Rule
ProxyRequests Off

<Proxy *>
Order deny,allow
Allow from all
</Proxy>

ProxyPass / http://server8/
ProxyPassReverse / http://server8/
AllowEncodedSlashes On

我看到 Apache 使用 Fiddler 踢出以下内容:

http://192.168.203.34:9089/t/SkunkWorks/views/LabelLocalization/Dashboard?Language=3

目前很好。

我还看到请求到达反向代理通过的机器:

192.168.203.34 - - [19/Apr/2013:11:35:04 -0400] 80 "GET /t/SkunkWorks/views/LabelLocalization/Dashboard?Language=3 HTTP/1.1" "fe80::a53f:6156:2a22:378d, 192.168.203.34" 200 4052 "-" 109186 UXFkKMCoyx0AAAA0Q2UAAAEM

但是,在目标计算机 (192.168.203.29) 上执行工作的应用程序没有正确响应。它没有使用特定语言呈现报告,而是挂起。

如果我http://192.168.203.29/t/SkunkWorks/views/LabelLocalization/Dashboard?Language=3 直接针对应用服务器执行,则报告呈现良好。似乎是导致问题的重写规则。

为什么?我在error.log中看到了这个:

[Fri Apr 19 10:55:55.194288 2013] [rewrite:trace2] [pid 13240:tid 712] mod_rewrite.c(468): [client fe80::a53f:6156:2a22:378d:32996] fe80::a53f:6156:2a22:378d - - [simpleprime/sid#982130][rid#dbcd50/initial] init rewrite engine with requested uri /t/SkunkWorks/views/LabelLocalization/Dashboard
[Fri Apr 19 10:55:55.194288 2013] [rewrite:trace3] [pid 13240:tid 712] mod_rewrite.c(468): [client fe80::a53f:6156:2a22:378d:32996] fe80::a53f:6156:2a22:378d - - [simpleprime/sid#982130][rid#dbcd50/initial] applying pattern '/t/SkunkWorks/views/LabelLocalization/Dashboard$' to uri '/t/SkunkWorks/views/LabelLocalization/Dashboard'
[Fri Apr 19 10:55:55.194288 2013] [rewrite:trace2] [pid 13240:tid 712] mod_rewrite.c(468): [client fe80::a53f:6156:2a22:378d:32996] fe80::a53f:6156:2a22:378d - - [simpleprime/sid#982130][rid#dbcd50/initial] rewrite '/t/SkunkWorks/views/LabelLocalization/Dashboard' -> '/t/SkunkWorks/views/LabelLocalization/Dashboard?Language=3[L,PT]'
RIGHT HERE ->>>>[Fri Apr 19 10:55:55.194288 2013] [rewrite:trace3] [pid 13240:tid 712] mod_rewrite.c(468): [client fe80::a53f:6156:2a22:378d:32996] fe80::a53f:6156:2a22:378d - - [simpleprime/sid#982130][rid#dbcd50/initial] split uri=/t/SkunkWorks/views/LabelLocalization/Dashboard?Language=3[L,PT] -> uri=/t/SkunkWorks/views/LabelLocalization/Dashboard, args=Language=3[L,PT]**

如果我简化规则并删除 ?Language=3,则一切正常:

RewriteRule    /t/SkunkWorks/views/LabelLocalization/Dashboard$    /t/SkunkWorks/views/LabelLocalization/Dashboard  [L,PT]

我可以使用反向代理

http://192.168.203.34/t/SkunkWorks/views/LabelLocalization/Dashboard?Language=3

...并且它被正确地传递到 192.168.203.29 盒子。机器按应有的方式呈现报告。

我猜测“URI SPLIT”是问题的原因......因为当我在 error.log 中看不到它时事情会起作用,而当我这样做时它们会中断。

我能做些什么来防止 URI 拆分?

4

0 回答 0