我在 apache2.4 反向代理中遇到了问题。
Appache 配置:
ProxyPass "/" "http://domain2.com"
ProxyPassReverse "/" "http://domain2.com/"
SetEnv force-proxy-request-1.0 1
SetEnv proxy-nokeepalive 1
# If the path restricted cookie is set or the request asks for Javascript, images, or other content we don't need to protect
RewriteCond %{HTTP_COOKIE} t_path=.+
#RewriteCond %{REQUEST_URI} \.(?!(html|htm|pdf))
RewriteRule ^/(.*)$ http://domain2.com/$1 [P,QSA]
# If we have a token in the query string, verify it
RewriteCond %{QUERY_STRING} t=(.+)$
RewriteRule ^(/.*) /auth/?path=$1 [passthrough,QSA]
RewriteRule ^.*$ - [F]
<Location /test>
SetHandler modperl
PerlOptions +GlobalRequest
PerlResponseHandler test::Handler
</Location>
如果我点击网址http://domain1.com/abc/cdb/?t=787986在浏览器中,它抛出错误“ The requested URL /auth/ was not found on this server.
”此外,如果我执行以下步骤“删除反向代理行->重新启动 apache->在浏览器中点击 url->添加反向代理行-重新启动 apache”,则可以正常工作(可能被缓存)。test::Handler
将检查有效的 url 及其参数并设置返回重定向 url。反向代理和位置存在问题。请有人帮助我解决。