大网数据广告活动
服务器运维问答

Apache decoding semicolon - mod_proxy

· 52CE 我爱测

Apache, receiving a request with an encoded semicolon (%3B) is decoding it before passing the request to a proxy (backend of Spring Tomcat). Relevant apache Virtual host lines are: ProxyPreserveHost on RequestHeader set X-Forward…

问题原文

原帖链接 · Baker · CC BY-SA 3.0

Apache, receiving a request with an encoded semicolon (%3B) is decoding it before passing the request to a proxy (backend of Spring Tomcat).

Relevant apache Virtual host lines are:

ProxyPreserveHost on
RequestHeader set X-Forwarded-Proto https
ProxyPass / http://127.0.0.1:8081/
ProxyPassReverse / http://127.0.0.1:8081/

So for example when a request for URL like

http://testsite.com/page/%27+many+times%3B+the+valiant/author

Would be proxy forwarded as

http://testsite.com/page/%27+many+times/author

Is there something I can do to prevent apache from decoding that URL before forwarding it to proxy?

Perhaps relevant issue noted on apache.org/bugzilla

已采纳解答

原帖链接 · Federico Sierra · CC BY-SA 3.0

mod_proxy canonicalise URLs passed to the backend. If you want suppress this behavior use nocanon keyword and this passes the URL path "raw" to the backend.

Eg:

ProxyPass / http://127.0.0.1:8081/ nocanon

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-09-20)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。