0

我有 Apache 反向代理,它对使用 mod_jk 连接 tomcat 的后端 Apache 提出请求,应用程序位于 Apache 反向代理中的 java/jsps 中我有这个配置,当 GET 请求中存在不带参数的请求时有效:

ProxyRequests     Off
ProxyPreserveHost On
ProxyPass /users/ http://1x2.xxx.4.xx:5xxxx/jsp/app/New/
ProxyPassReverse /users/  http://1x2.xxx.4.xx:5xxxx/jsp/app/New/
CustomLog /home/Apache/logs/proxy_log common

mod_proxy 日志:

1xx.1xx.3.xx - - [20/Nov/2012:14:07:54 +0200] "GET /users/ HTTP/1.1" 200 3547
1xx.1xx.3.xx - - [20/Nov/2012:14:07:57 +0200] "GET /users/ HTTP/1.1" 200 3547
1xx.1xx.3.xx - - [20/Nov/2012:14:07:58 +0200] "GET /users/index.jsp?event=pi&id=&p= HTTP/1.1" 200 3615
1xx.1xx.3.xx - - [20/Nov/2012:14:08:02 +0200] "GET /users/ HTTP/1.1" 200 3547
1xx.1xx.3.xx - - [20/Nov/2012:14:08:07 +0200] "GET /users/index.jsp?event=pi&id=test&p=test HTTP/1.1" 200 3615
1xx.1xx.3.xx - - [20/Nov/2012:14:16:48 +0200] "GET /users/ HTTP/1.1" 200 3547
1xx.1xx.3.xx - - [20/Nov/2012:14:27:05 +0200] "GET /users/index.jsp?event=pi&id=test&p=test HTTP/1.1" 302 -
1xx.1xx.3.xx - - [20/Nov/2012:14:27:05 +0200] "GET /jsp/app/New/Home.jsp?event=Validated HTTP/1.1" 404 306
1xx.1xx.3.xx - - [20/Nov/2012:14:29:25 +0200] "GET /users/index.jsp?event=pi&id=test&p=test HTTP/1.1" 302 -
1xx.1xx.3.xx - - [20/Nov/2012:14:29:25 +0200] "GET /jsp/app/New/Home.jsp?event=Validated HTTP/1.1" 404 306
1xx.1xx.3.xx - - [20/Nov/2012:15:11:37 +0200] "GET /users/ HTTP/1.1" 200 3547
1xx.1xx.3.xx - - [20/Nov/2012:15:11:44 +0200] "GET /users/index.jsp?event=pi&id=test&p=test HTTP/1.1" 302 -
1xx.1xx.3.xx - - [20/Nov/2012:15:11:45 +0200] "GET /jsp/app/New/Home.jsp?event=Validated HTTP/1.1" 404 306

如您所见,每次收到以下响应时:

"GET /jsp/app/New/Home.jsp?event=Validated HTTP/1.1" 404 306


当我尝试在没有代理服务器的情况下直接使用它时,该页面无法正常工作。

4

1 回答 1

0

您需要使用 Apache Httpd v2.2+ 并在 ProxyPass 配置中指定“nocanon”选项,该选项告诉 Apache 不要规范化请求查询字符串:

ProxyPass /users/ http://1x2.xxx.4.xx:5xxxx/jsp/app/New/ nocanon
于 2013-01-22T20:58:47.183 回答