Tomcat HTTPS 리다이렉트
반응형
톰캣서버 구동 시 http접속을 강제로 https로 돌리는 방법이다. 톰캣 기본은 http를 8080으로 접속하고 https를 8443으로 접속하게 설정되어 있지만, 아래는 80으로 되어있는 것을 443으로 리다이렉트 시킨다.
1) Tomcat 홈 디렉토리에서 server.xml 구성 파일을 업데이트하고 해당 구성의 다음 부분을 변경한다.
<Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" URIEncoding="UTF-8" redirectPort="8443" /> <Connector port="80" enableLookups="false" redirectPort="443" />
2) Tomcat 홈 디렉토리의 web.xml 구성 파일을 업데이트하고 닫기 전에 다음 내용을 끝에 추가한다.
<security-constraint> <web-resource-collection> <web-resource-name>Protected Context</web-resource-name> <url-pattern>/*</url-pattern> </web-resource-collection> <user-data-constraint> <transport-guarantee>CONFIDENTIAL</transport-guarantee> </user-data-constraint> </security-constraint>
3) Tomcat 서블릿 컨테이너를 다시 시작하면 끝난다. Tomcat은 항상 보안 연결이 필요하다.
반응형
댓글
이 글 공유하기
다른 글
-
Devices Changed (CPU or Memory) or CMOS have been Cleared
Devices Changed (CPU or Memory) or CMOS have been Cleared
2021.02.01 -
CentOS 6.* yum update 오류 해결
CentOS 6.* yum update 오류 해결
2021.01.06 -
리눅스 서버 NTP 시간 동기화 설정
리눅스 서버 NTP 시간 동기화 설정
2019.07.06 -
리눅스 서버 V3 Net 백신 설치
리눅스 서버 V3 Net 백신 설치
2019.06.23