mod_rewrite で外部ホストへ転送(で良いのかな?)
2009-06-08


mod_rewrite には 'proxy|P' (force proxy) というフラグがあるらしい

[URL]

'proxy|P' (force proxy)
  This flag forces the substitution part to be internally 
  sent as a proxy request and immediately (rewrite processing stops here) 
  1put through the proxy module. You must make sure that the 
  substitution string is a valid URI (typically starting with [URL] 
  which can be handled by the Apache proxy module. 
  If not, you will get an error from the proxy module. 
  Use this flag to achieve a more powerful implementation 
  of the ProxyPass directive, to map remote content into 
  the namespace of the local server.

いやまあ、とあるドメインで稼動している Apache のサブディレクトリを 全く別のホストに割り当てたいという要求があって、 リバースプロキシをかけるなら mod_proxy だろJKぐらいの勢いで用意した設定を、FQDNを割り当てられているホストの管理者に投げたら 「うちのホストは mod_proxy を有効にしていないんで(ry)」みたいな返答が返ってきた。

mod_rewrite を使って欲しいと言われたのだが、mod_rewrite なんて同一ホスト内でのパスの書き換えの黒魔法ぐらいにしか使った事がないし、試しに書き換え後のアドレスにホスト名から書いてみたところ、 'redirect|R' (force redirect) のフラグの有無に関わらず、redirectになってしまう。

「んじゃ、そっちのWebサーバからAPサーバの転送ってどうやってんの?」 と教えてもらったのが、このフラグ。

だけどさ、同じセクションに

Note: mod_proxy must be enabled in order to use this flag.

と書いてあるのだが……。

[Apache]

コメント(全0件)
コメントをする


記事を書く
powered by ASAHIネット