Isapi Rewrite-로드 밸런서 뒤에 리디렉션에서 HTTPS 보존
-
16-09-2019 - |
문제
HTTP 용 2 개의 개별 하위 도메인이 있고 다른 하나는 https 용 사이트를 실행하고 있습니다.
http://www.example.com
https://secure.example.com
http://secure.example.com
존재하지 않으며 해결되지 않습니다.
문제는 사이트가 모든 SSL을 처리하는로드 밸런서 뒤에서 실행되고 있다는 것입니다. 항상 HTTP의로드 밸런서와 웹 서버 간의 통신.
따라서 ISAPI를 사용할 때 3 (IIS 용 Mod_rewrite 클론)을 다시 작성하여 일부 리디렉션을 구현하여 문제가 발생합니다.
isapi rewrite에 관한 한 https가 꺼져 있습니다. secure.example.com
실패하고 있습니다.
다음과 같은 규칙이 있다고 말합니다.
RewriteRule ^/example/$ /test/ [R=301,L]
내가 요청하는 경우 https://secure.example.com/example/
나는 끝나고 싶다 https://secure.example.com/test/
그러나 Isapi Rewrite는 https를 끄는 것으로 보이기 때문에 끝납니다. http://secure.example.com/test/
.
도메인이있는 경우 리디렉션을 HTTP로 강제로 강제로 할 수있는 방법이 있습니까? secure.example.com
?
이것의 선을 따라 무언가 :
RewriteCond %{SERVER_NAME} secure.example.com
RewriteRule ^/(.*)$ https://secure.example.com/$1
제외하고는 작동하지 않습니다. RewriteRules
.
감사,
스튜
해결책
다음과 같은 SMTH는 어떻습니까 :
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^secure\.mydomain\.com$ [NC]
RewriteRule ^/example/$ https://secure.mydomain.com/test/ [R=301,L]
제휴하지 않습니다 StackOverflow