2017-06-14 24 views
0

ProxyPassMatchは次のような要求を生成すると予想していました:ApacheのProxyPassMatchループ要求

http://localhost/containers/asd123qwe/json 

ループ状態が発生する可能性はありますか? ProxyPassMatchは、Apacheで内部リクエストを再度生成するか、コンフィグレーションの指示に従って簡単にソケットに転送しますか?

log_forensic_moduleを使用する以下のようにログを取得します。そのため、問題として無限ループ要求を検討しています。長い出力のため申し訳ありません!

GET /containers/f1063abfd92409/json HTTP/1.1|Host:server.domain%3a8080|Connection:keep-alive|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2|X-Forwarded-Host:server.domain%3a8080|X-Forwarded-Server:127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost, localhost, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost, localhost, localhost, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost, localhost, localhost, localhost, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
GET /containers/f1063abfd92409/json HTTP/1.1|Host:localhost|Upgrade-Insecure-Requests:1|User-Agent:Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.36|Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8|Accept-Encoding:gzip, deflate, sdch|Accept-Language:en-US,en;q=0.8,pt-BR;q=0.6,pt;q=0.4|X-Forwarded-For:10.255.0.2, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|X-Forwarded-Host:server.domain%3a8080, localhost, localhost, localhost, localhost, localhost, localhost, localhost, localhost|X-Forwarded-Server:127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1, 127.0.0.1|Connection:close 
+0

私はApacheの専門家ではありませんが、あなたの正規表現はうまく動作するはずですので、問題の原因が広がっているかどうかを調べることをお勧めします。 –

+0

@DmitryVolkovあなたのコメントのおかげで、私はそれをしようとしていますが、私はなぜそれが動作していないの良い説明と任意の場所を見つけることができません。私はあなたに同意する、それは動作するはずです。 – Azize

答えて

0

だけで実行します。

^\/containers\/[a-zA-Z0-9_]+?\/json$ 

これはいい加減に私がしたいと仮定するものである次のforwardslash /、までは任意の英数字と一致します。

+0

あなたの投稿のおかげで、あなたは正しいです、私は '/'まで任意のcharを必要としますが、なぜ動作していないのかわかりません。 – Azize

+0

@Azize私の編集を参照してください、あなたはスラッシュをエスケープする必要があると思います。 – Jokab

+0

スチールは機能していない、それは非常に奇妙です。私はそれに括弧を入れて、それ以外の場合私はプロキシのURLでそれを使用することはできません。それは 'ProxyPassMatch"^\/containers \ /([a-zA-Z0-9 _] +?)\/json $ "unix:/var/run/docker.sock | http:// localhost/containersという行です。/$ 1/json' – Azize

関連する問題