【发布时间】:2012-02-18 16:12:14
【问题描述】:
我有一个 Apache 服务器,它在我们的 DMZ 中用作反向代理。我们有一个外部服务回发到此服务器上的特定 URL。现在需要将此服务回发到一个全新的应用程序,但这很可能会在不久的将来再次发生变化,因为我们目前正处于测试阶段。
为了解决这个问题,我尝试接收传入的回发请求/smsPostback.php,并将其重写为新的相对 URL,/SMSHandler/Process。这部分工作正常。
然而,在配置下面立即定义,我有一个 ProxyPass 指令将所有到 /SMSHandler 的流量代理到内部服务器。
这些是 apache conf 文件中的新行:
RewriteRule ^/smsPostback.php$ /SMSHandler/Process
##Proxy pass smshandler
ProxyPass /SMSHandler http://172.29.61.49:8080/SMSHandler
ProxyPassReverse /SMSHandler http://172.29.61.49:8080/SMSHandler
这些是重写日志中的日志:
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) init rewrite engine with requested uri /smsPostback.php
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (3) applying pattern '^/smsPostback.php$' to uri '/smsPostback.php'
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) rewrite '/smsPostback.php' -> '/SMSHandler/Process'
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) local path result: /SMSHandler/Process
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (2) prefixed with document_root to C:/hidden.com/SMSHandler/Process
172.29.61.49 - - [24/Jan/2012:18:43:36 --0500] [test.hidden.com/sid#5eace0][rid#446b770/initial] (1) go-ahead with C:/hidden.com/SMSHandler/Process [OK]
这是来自 apache 的错误日志条目:
[Tue Jan 24 18:43:36 2012] [error] [client 172.29.61.49] File does not exist: C:/fmfacilitymaintenance.com/SMSHandler
关于为什么它从不反向代理请求,而是尝试(并且失败)在本地服务它的任何想法?谢谢!
【问题讨论】:
标签: apache mod-rewrite reverse-proxy