fix: 앞단 프록시 뒤 실제 접속 IP를 nginx 가 꺼내 쓰게 함 — 비로그인 좋아요가 모든 방문자를 한 사람으로 세던 문제

This commit is contained in:
minaChoi committed 2026-10-20 17:33:55 +09:00
1 parent 12f4eca8a8
commit 59f74e46ba
1 file changed
+6
+6
View File
@@ -5,6 +5,12 @@ server {
index index.html;
# 폴더 주소로 넘길 때 포트가 빠지지 않게 상대 주소로 보낸다
absolute_redirect off;
# 앞단 프록시(사설망)가 붙인 X-Forwarded-For 에서 실제 접속 주소를 꺼내 $remote_addr 로 쓴다 (비로그인 좋아요를 IP 로 세려고)
set_real_ip_from 172.16.0.0/12;
set_real_ip_from 10.0.0.0/8;
set_real_ip_from 192.168.0.0/16;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
gzip on;
gzip_types text/css application/javascript image/svg+xml application/json;