특정 URL 요청을 http로 호출하고 그 외의 호출들은 https로 호출하는 방법입니다.
여러가지 방법이 있겠지만, 작성자는 Web Server의 Rewrite를 활용하였습니다.
[DENY URL]
- /netzero
- /test
[호출 Domain]
- http://mail.test.com/test.jsp
- https://mail.test.com/test.jsp
- http://mail.test.com/netzero/test.jsp
- https://mail.test.com/netzero/test.jsp
- http://mail.test.com/netzero/test.jsp
- https://mail.test.com/netzero/test.jsp
*VHOST 절 설정
v_mail DOCROOT="/home/webtob5_1/webtob/docs/resource/",
HOSTNAME = "192.168.40.137",
HOSTALIAS = "mail.test.com",
PORT = "80",
ServiceOrder = "uri,ext",
ERRORDOCUMENT = "403,404,503",
METHOD = "GET, POST, -HEAD, -OPTIONS",
URLRewrite = Y,
URLRewriteConfig = "config/rewrite.conf",
#Headers = "gzip,cors_all",
LOGGING = "acc_mail",
ERRORLOG = "err_mail"
v_mail_ssl DOCROOT="/home/webtob5_1/webtob/docs/resource/",
HOSTNAME = "192.168.40.137",
HOSTALIAS = "mail.test.com",
PORT = "443",
ServiceOrder = "uri,ext",
ERRORDOCUMENT = "403,404,503",
METHOD = "GET, POST, -HEAD, -OPTIONS",
URLRewrite = Y,
URLRewriteConfig = "config/rewrite_ssl.conf",
SSLFLAG = Y,
SSLNAME = "ssl_tmax",
LOGGING = "acc_mail",
ERRORLOG = "err_mail"
*rewrite.conf 조건
- Client에서 http 요청이 들어올 경우
- Client에서 /netzero 의 URL 로 요청이 들어올 경우 rewrite 사용 X
- Client에서 /test 의 URL 로 요청이 들어올 경우 rewrite 사용 X
- 그 외 모든 호출은 https로 rewrite
#rewrite.conf
RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} !^/netzero/
RewriteCond %{REQUEST_URI} !/test/
RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L]
*rewrite_ssl.conf 조건
- Client에서 직접 https로 /netzero URL을 호출한 경우
- Client에서 직접 https로 /test URL을 호출한 경우
#rewrite_ssl.conf
RewriteRule /netzero/ http://%{HTTP_HOST}%{REQUEST_URI} [L]
RewriteRule /test/ http://%{HTTP_HOST}%{REQUEST_URI} [L]
* TEST PAGE 호출
1. http://mail.test.com/test.jsp
2. https://mail.test.com/test.jsp
3. http://mail.test.com/netzero/test.jsp
4. https:///mail.test.com/netzero/test.jsp
5.http://mail.test.com/test/test.jsp
6.https://mail.test.com/test/test.jsp
'MiddleWare > WebtoB' 카테고리의 다른 글
[WebtoB] 414 Request-URI Too Large 오류 해결 방법 (0) | 2023.10.17 |
---|---|
[WebtoB] 특정 요청에만 http로 호출하는 방법 (1) | 2023.10.17 |
[WebtoB] Jmeter를 활용하여 다중 IP 호출 확인하기 (2) | 2023.05.10 |
[WebtoB] HTH, HTL, WSM 이란? (0) | 2023.05.09 |
[WebtoB] 단일 서버에서 다중 WebtoB 기동 시 유의사항 (0) | 2023.03.15 |