콘텐츠로 건너뛰기

Nginx Reverse Proxy 사용 시 Apache에서 Real IP 받아오기

  • by

Nginx 리버스 프록시를 사용하면 Apache에서 프록시 서버의 IP로 인식되는 문제가 있다.

a2enmod remoteip

Apache remoteip 모드를 추가하고

RemoteIPHeader X-Forwarded-For
RemoteIPTrustedProxy 프록시_서버 주소 (e.g. RemoteIPTrustedProxy 192.168.1.100)

위의 Apache Directives를 추가하면 아래와 같이 클라이언트 IP가 정상적으로 인식된다.

Join the conversation

이메일 주소는 공개되지 않습니다. 필수 필드는 *로 표시됩니다