디시인사이드 갤러리

갤러리 이슈박스, 최근방문 갤러리

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 293 추천 0 댓글 3

안녕하세요. 매번 질문만 드리고 죄송스러울 뿐입니다.

배워가는 사람으로써 가르쳐 드리지도 못하고 ㅠㅠ 꼭 많이 배워서 좀 더 많은걸 알리겠습니다!

 

서론이 길었습니다. NPM을 사용하고 있고 docker로 이용하고있습니다

 

 자바 스프링으로 응답값만 보내주고 프론트 리액트에서 서버 배포해서 응답값을 받아와서 처리 해서 사이트를 하나만들었는데

백앤드 포트는 8888 이고

프론트 포트는 3000 입니다

 window 환경입니다

지금 문제가 뭐냐면 접속한 사람의 ip를 가져올 때 실제 ip 저장이 아닌 모든 ip가 172.17.0.1 로 저장됩니다.ㅠㅠ

 

npm
Advanced

Custom Nginx Configuration 설정은

set_real_ip_from 172.17.0.0/16;
real_ip_header X-Forwarded-For;
real_ip_recursive on;

# NPM 환경 최적화 설정 - real_ip_module 없이 실제 IP 전달

client_max_body_size 100M;
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;

# ?? 실제 클라이언트 IP 전달을 위한 헤더 설정
# $proxy_add_x_forwarded_for 사용

# 루트 API
location ~ ^/(login|r.egister|logout|refresh|test|boards|comments|commands|notices|admin|balances|change-password|me|deactivate) {
    proxy_pass http://192.168.55.130:8888;

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;

    proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Client-IP $proxy_add_x_forwarded_for;
    proxy_set_header True-Client-IP $proxy_add_x_forwarded_for;

    proxy_http_version 1.1;
    proxy_set_header Connection "";

    add_header 'Access-Control-Allow-Origin' '$scheme://$host' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-CSRF-Token' always;
    add_header 'Access-Control-Allow-Credentials' 'true' always;
    add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range' always;

    if ($request_method = 'OPTIONS') {
        add_header 'Access-Control-Allow-Origin' '$scheme://$host' always;
        add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH' always;
        add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-CSRF-Token' always;
        add_header 'Access-Control-Allow-Credentials' 'true' always;
        add_header 'Access-Control-Max-Age' 1728000;
        add_header 'Content-Type' 'text/plain; charset=utf-8';
        add_header 'Content-Length' 0;
        return 204;
    }
}

# /api 경로
location /api/ {
    proxy_pass http://192.168.55.130:8888/;

Loading

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;

    proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Client-IP $proxy_add_x_forwarded_for;
    proxy_set_header True-Client-IP $proxy_add_x_forwarded_for;

    proxy_http_version 1.1;
    proxy_set_header Connection "";

    add_header 'Access-Control-Allow-Origin' '$scheme://$host' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS, PATCH' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always;
    add_header 'Access-Control-Allow-Credentials' 'true' always;
}

# 마인크래프트 API
location /minecraft/ {
    proxy_pass http://192.168.55.130:8888/minecraft/;

Loading

    proxy_set_header Host $host;
    proxy_set_header X-Forwarded-Proto $scheme;

    proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Client-IP $proxy_add_x_forwarded_for;
    proxy_set_header True-Client-IP $proxy_add_x_forwarded_for;

    add_header 'Access-Control-Allow-Origin' '$scheme://$host' always;
    add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
    add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' always;
    add_header 'Access-Control-Allow-Credentials' 'true' always;
}

# 정적 업로드 파일
location /uploads/ {
    proxy_pass http://192.168.55.130:8888/uploads/;

Loading

    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

    location ~* \.(jpg|jpeg|png|gif|ico|css|js|pdf|zip)$ {
        proxy_pass http://192.168.55.130:8888;
        add_header Cache-Control "public, max-age=31536000, immutable";
        add_header X-Cache-Status "HIT-NPM";
        expires 1y;
    }

    add_header Cache-Control "public, max-age=3600";
    expires 1h;
}

# 디버그용
location /debug-ip {
    add_header Content-Type "text/plain; charset=utf-8";
    return 200 "?? NPM IP 전달 상태 확인:

=== 현재 전달되는 IP 정보 ===
Remote Address: \$remote_addr
X-Forwarded-For: \$proxy_add_x_forwarded_for

=== Spring Boot로 전달되는 헤더들 ===
X-Real-IP: \$proxy_add_x_forwarded_for
X-Forwarded-For: \$proxy_add_x_forwarded_for
X-Client-IP: \$proxy_add_x_forwarded_for
True-Client-IP: \$proxy_add_x_forwarded_for

=== 요청 정보 ===
Host: \$host
Protocol: \$scheme
User-Agent: \$http_user_agent
Request URI: \$request_uri

? real_ip_module 없이 클라이언트 IP 전달 설정 완료
";
}

이렇습니다

무슨 짓을 해도  172.17.0.1 로 저장되네요 ㅠㅠㅠ

 몇시간을 구글링하고 수정해도 안되서 질문글 남깁니다 ㅠ

추천 비추천

0

고정닉 0

0

댓글 영역

전체 댓글 0
본문 보기

하단 갤러리 리스트 영역

왼쪽 컨텐츠 영역

갤러리 리스트 영역

갤러리 리스트
번호 제목 글쓴이 작성일 조회 추천
설문 대박 날 것 같아서 내 꿈에 나와줬으면 하는 스타는? 운영자 25/11/17 - -
AD 겨울가전 SALE! 쿨한 겨울 HOT세일 운영자 25/11/12 - -
2871286 vala 메모리 실수 발명도둑잡기(118.235) 07.13 101 0
2871284 carbon 메모리 실수 발명도둑잡기(118.235) 07.13 95 0
2871282 C++ 20 이상 메모리 실수 [1] 발명도둑잡기(118.235) 07.13 173 0
2871281 rust 메모리 실수 [1] 발명도둑잡기(118.235) 07.13 115 0
2871280 vale 언어 메모리 실수 [1] 발명도둑잡기(118.235) 07.13 107 0
2871279 nim 언어 메모리 실수 [1] 발명도둑잡기(118.235) 07.13 104 0
2871277 D 언어 메모리 실수 [1] 발명도둑잡기(118.235) 07.13 113 0
2871276 odin 메모리 관리 실수 줄이기 [1] 발명도둑잡기(118.235) 07.13 132 0
2871274 zig 언어 메모리 수동관리 c보다 실수 적게 만들었나 [3] 발명도둑잡기(118.235) 07.13 130 0
2871272 디씨 극우 등신새끼들은 assembl-y를 차단어로 설정해 국회 청원을 [1] 발명도둑잡기(118.235) 07.13 99 0
2871270 si 이상으로 에이전시는 더 별루야 [1] 피치피(183.101) 07.13 119 0
2871269 인터프리터 아니고 컴파일 되는 자바스크립트나 타입스크립트 문법 언어 [2] 발명도둑잡기(118.235) 07.13 126 0
2871267 git이 SVN을 능가하는 최고 장점이 수익화하기 편하다는거 [6] ㅆㅇㅆ(124.216) 07.13 173 0
2871266 그놈이 느려진 이유가 자바스크립트 많이 써서인가 [4] 발명도둑잡기(118.235) 07.13 125 0
2871264 난 정말 뭐할까 ㅠ [3] 피치피(183.101) 07.13 110 0
2871263 git이 표준이 된 이유는 github 소셜이 큰거 같음 [8] ㅆㅇㅆ(124.216) 07.13 147 0
2871262 나는 암만 생각해도 SVN이 더 편한거 같은데 [1] ㅆㅇㅆ(124.216) 07.13 110 1
2871261 svn에서 깃 전환하고 느낀것인데 [7] ㅆㅇㅆ(124.216) 07.13 133 0
2871260 환자가 천천히 나을수록 의사는 돈을 더 번다는 역설 [1] 발명도둑잡기(118.235) 07.13 102 0
2871258 근데 삼촌 빡고수라던데 왜 프갤 탈퇴한거냐 [2] ㅆㅇㅆ(124.216) 07.13 152 0
2871256 computer란 사라진 직업 발명도둑잡기(118.235) 07.13 113 0
2871254 문화계 만난 이 대통령 “예술인 기본소득 필요” 발명도둑잡기(118.235) 07.13 96 0
2871252 방금 전 뜬 9GAG 릴스 혼자 하는 테니스 릴스 영상 보니 발명도둑잡기(118.235) 07.13 78 0
2871251 삼촌이 100% 자동화 백엔드 도구 만들었던데 [1] 프갤러(183.101) 07.13 212 0
2871250 동양철학:남에게 받은건 바위에 새기고, 도운것은 모래에 새겨라 ㅇㅇ(183.101) 07.13 80 0
2871249 오늘의 소설, 영화 실마리: 일제와 나치의 동맹과 몰락 이야기 발명도둑잡기(118.235) 07.13 99 0
2871247 '노동존중' 이재명 정부와 최저임금법 제1조[노동TALK] 발명도둑잡기(118.216) 07.13 86 0
2871246 히틀러에게 훈장을 받은 일본 해군장교 발명도둑잡기(118.216) 07.13 77 0
2871243 오늘의 영상 기획 실마리: 컴퓨터 팬으로 드론 발명도둑잡기(118.235) 07.13 75 0
2871242 탑골공원은 일제의 압제를 뚫고 기미독립선언을 했던 장소임 발명도둑잡기(118.235) 07.13 74 0
2871240 냥덩이 똥구멍 찢길 예정 발명도둑잡기(118.235) 07.13 70 0
2871239 세상에 대한 원망과 슬픔이 느껴지는 글이 있다 발명도둑잡기(118.235) 07.13 84 0
2871238 전광훈 자유마을 업드려뻗쳐와 에스파-더티 워크 풍자 발명도둑잡기(118.235) 07.13 66 0
2871231 결혼정보회사 대표가 솔직하게 말하는 며느리 조건 발명도둑잡기(118.216) 07.13 85 1
2871230 편부모가정에 하명뿐인 부모님은 공무원인데 [2] 프갤러(58.72) 07.13 109 0
2871229 세븐틴 떠리 에이~ 루도그담당(58.239) 07.13 102 0
2871228 발도잡행님 도배 보면서 느끼는데 국가 장학금 받아먹었는데 배급견 욕하는건 ㅆㅇㅆ(124.216) 07.13 101 0
2871227 오늘의 소설, 영화 실마리: 집단 따돌림 피해자 동맹 발명도둑잡기(118.235) 07.13 65 0
2871225 요즘 mz사이에서 유행중이라는 콘텐츠 발명도둑잡기(118.216) 07.13 79 0
2871224 요즘 인기라는 日 할머니 대여 서비스 발명도둑잡기(118.216) 07.12 76 0
2871223 학생넷이랑 알찬 여름 함께하지 않을래? 발명도둑잡기(118.235) 07.12 75 0
2871222 오늘의 소설, 영화 실마리: 계좌 비공개 은행이 고객 살인청부해 돈 갈취 발명도둑잡기(118.235) 07.12 69 0
2871221 오늘의 게임, 소설, 영화 실마리: 인간과 귀신의 대결 작품 발명도둑잡기(118.235) 07.12 62 0
2871219 이재명 대통령 쭈꾸미삼겹살집 회동 보니 드는 생각 [1] 발명도둑잡기(118.216) 07.12 105 0
2871218 "네 여자친구 10분이면 꼬셔"..지인 폭행한 20대 징역형 발명도둑잡기(118.216) 07.12 72 0
2871216 이중 갈취로 '홀로캐시'(holocash) 뜯어낸 유대인 파워의 민낯 발명도둑잡기(118.216) 07.12 60 0
2871215 국내에만 29억개…무방비 IoT 기기, 사생활 유출 부른다 발명도둑잡기(118.216) 07.12 82 0
2871214 청혼 도중 폭포 아래로 추락…영상 확산에 누리꾼 '충격' 발명도둑잡기(118.216) 07.12 108 0
2871213 대동아냥덩권⭐ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07.12 89 0
2871212 역대급 1위 터졌다…‘충격’에 휩싸인 일본 발명도둑잡기(118.216) 07.12 95 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2