Appache 2.4 - 帶有位置指令的反向代理程式不起作用

Appache 2.4 - 帶有位置指令的反向代理程式不起作用

我在 apache2.4 反向代理中遇到問題。

應用程式配置

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。反向代理和位置有問題。請有人幫我解決。

相關內容