스프링 기반의 웹프로그램을 아래와 같이 동일 도메인을 사용하면서 포트를 다르게 하여 사용자와 관리자를 분리하도록 구성을 하였다.
- https://www.demo.co.kr
- https://www.demo.co.kr:8888
주요 환경은 아래와 같다.
- 네이버 클라우드 LB 을 이용한 https 구현
- CentOS 7.8.2003
- Apache 2.4.53
- Tomcat 9.0.63
- Open JDK 11.0.15.x
- Spring 4.3.1.RELEASE
- Spring Security 4.1.2.RELEASE
이슈는 권한이 없는 경우 로그인 페이지로 리다이렉션이 되는데 https://www.demo.co.kr:8888 접속을 하였으나 http://www.demo.co.kr:8888/login 로 리다이렉션이 되는 이슈가 발생했다.
가장 많이 검색되는 방법이 <intercept-url pattern = "/**" filters = "none" requires-channel = "https" > 와 같이 requires-channel 을 추가하는 것이었지만 문제는 해결되지 않았다.
이문제는 톰켓에 RemoteIpValve 설정을 아래와 같이 추가하는 것으로 해결할 수 있었다.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Valve | |
className="org.apache.catalina.valves.RemoteIpValve" | |
internalProxies=".*" | |
protocolHeader="X-Forwarded-Proto" | |
httpsServerPort="888" | |
/> |
댓글 없음:
댓글 쓰기