わかりました、apache IBM HTTP Server WAS 6.1
セットアップができました
certs
正しくインストールされ、ページを正常にロードできhttp
ますhttps
。
j_security_check
経由で認証が成功した後https
、現在承認されているページ (および後続のすべてのページ) を としてロードしhttp
ます。
mod_rewrite
Webサーバー上で本当に簡単に実行できるはずのアプリケーションコードを変更したくないので、これをすべて機能させたいと思っています。
これはうまくいくと思いますが、そうではなく、何らかの形j_security_check
でバイパスしているためだと思います。mod_rewrite
RewriteCond %{HTTPS} =off
RewriteCond %{THE_REQUEST} login\.jsp.*action=init [OR]
RewriteCond %{THE_REQUEST} login\.jsp.*action=submit
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R,L] <<-- this rule is working
RewriteCond %{HTTPS} =on
RewriteCond %{THE_REQUEST} !login\.jsp.*action=init [OR]
RewriteCond %{THE_REQUEST} !login\.jsp.*action=submit
RewriteRule .* http://%{SERVER_NAME}%{REQUEST_URI} [R,L] <--- this rule is not working or the condition is not returning true
[R,L]
実行されたルールがリクエストで実行される最後のルールになり、それに応じてリダイレクトされることを私は知っています。
少しググった後、この小さな宝石を見つけました。
mod_rewrite: My rules are ignored. Nothing is written to the rewrite log.
The most common cause of this is placing mod_rewrite directives at global scope (outside of any VirtualHost containers) but expecting the directives to apply to requests which were matched by a VirtualHost container.
In this example, the mod_rewrite configuration will be ignored for requests which are received on port 443:
RewriteEngine On
RewriteRule ^index.htm$ index.html
<VirtualHost *:443>
existing vhost directives
</VirtualHost>
Unlike most configurable features, the mod_rewrite configuration is not inherited by default within a <VirtualHost > container. To have global mod_rewrite directives apply to a VirtualHost, add these two extra directives to the VirtualHost container:
<VirtualHost *:443>
existing vhost directives
RewriteEngine On
RewriteOptions Inherit
</VirtualHost>
virtualhost
マシンのIPを指す単一の宣言にInherit宣言を追加しても、port 443
少しは役に立ちませんでした。
これで、アプリ サーバーが9080
と でそれぞれ通信していることがわかりましたが、Web サーバーで9443
1 つが見つかりません。virtualhost
httpd.conf
認証されていないときに、さまざまな書き換えルールでいくつかのテストを行い、mod rewrite
コードが機能することを確認しました..
では、認証後に websphere に mod rewrite を使用させるにはどうすればよいですか?
Web サーバーは認証されていないリクエストにのみ使用され、その後、何らかのブラックボックス コンテナーが何らかの方法ですべてを提供するようです。