디시인사이드 갤러리

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

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 72 추천 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/07/07 - -
AD 디지털 액세서리 기간한정 세일! 운영자 25/07/11 - -
공지 프로그래밍 갤러리 이용 안내 [88] 운영자 20.09.28 45412 65
2871218 "네 여자친구 10분이면 꼬셔"..지인 폭행한 20대 징역형 발명도둑잡기(118.216) 22:49 0 0
2871216 이중 갈취로 '홀로캐시'(holocash) 뜯어낸 유대인 파워의 민낯 발명도둑잡기(118.216) 22:42 2 0
2871215 국내에만 29억개…무방비 IoT 기기, 사생활 유출 부른다 발명도둑잡기(118.216) 22:40 3 0
2871214 청혼 도중 폭포 아래로 추락…영상 확산에 누리꾼 '충격' 발명도둑잡기(118.216) 22:28 4 0
2871213 대동아냥덩권⭐ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 22:28 10 0
2871212 역대급 1위 터졌다…‘충격’에 휩싸인 일본 발명도둑잡기(118.216) 22:27 6 0
2871211 나도 코딩 개고수가 되고 싶어 [3] 아스카영원히사랑해갤로그로 이동합니다. 22:17 27 0
2871210 내일 칼럼 하나 쓸깡? 쓸 주제가 뭐 있을까낭? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 22:12 12 0
2871208 주 1회 칼럼 써야하는댕,, ♥로스트미디어냥덩이♥갤로그로 이동합니다. 22:10 8 0
2871207 살 엄청 찌는 백종원피자 알바한 오해원 발명도둑잡기(118.216) 22:09 6 0
2871206 실존하는게 놀라운 지구상의 신비한 생물들 발명도둑잡기(118.216) 22:06 8 0
2871204 월 600 정도만 되어도 만족하겠다 아스카영원히사랑해갤로그로 이동합니다. 21:57 22 0
2871203 이효리, 달라진 예능 환경 언급 "10년 전 방송선 女 가슴 사이즈로 놀 발명도둑잡기(118.216) 21:28 18 0
2871202 친중좌파 2재명 탄핵운동행진⭐+ 가즈아앙 ♥로스트미디어냥덩이♥갤로그로 이동합니다. 21:27 13 0
2871201 [단독] “의리의 한소희”, 뒤늦게 알려진 미담…5천만원 상당 깜짝 선물 발명도둑잡기(118.216) 21:25 9 0
2871200 김충현의 죽음, 그날 그때 무슨 일이... "김충현은 어느 회사 직원이었 발명도둑잡기(118.216) 21:20 6 0
2871199 안녕하세요 선생님들 외주에 대해서 질문이 있습니다. 프갤러(119.192) 21:19 10 0
2871197 불과 한달만에 대한민국을 처참하게 망가뜨리고 잇는 2찢명 ♥로스트미디어냥덩이♥갤로그로 이동합니다. 21:11 9 0
2871195 SSD는 TRIM 동작하면 완전 복구 불가능이지 않나? [2] ㅆㅇㅆ(124.216) 21:09 22 0
2871193 드라마 <우리 영화> 재밌나요? 발명도둑잡기(118.216) 21:01 8 0
2871192 노래유튜버들은 롱런하기 힘든것같구나 [1] 헬마스터갤로그로 이동합니다. 20:52 21 0
2871191 현대차 비방글 올린 사람 아이디 rtOS인데 임베디드랑 관련있을지 모른다 발명도둑잡기(118.216) 20:52 28 0
2871190 오늘도 납골공원에 어르신들 바둑두시는구나 [4] 헬마스터갤로그로 이동합니다. 20:44 34 0
2871189 요즘시대에 스프링만으로는 살아남기 어렵지? [1] ㅇㅇ(118.235) 20:37 25 0
2871186 도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 20:11 17 0
2871183 고졸 10년차 연봉 6500 질문받음 [4] 프갤러(14.51) 19:47 47 0
2871182 도로롱!! 이 세상을 구해조! ♥로스트미디어냥덩이♥갤로그로 이동합니다. 19:46 26 0
2871181 참 살기좋은나라 축복받은나라여 ㅋㅋㅋㅋ 뒷.통수한방(1.213) 19:39 16 0
2871180 싱글벙글 AI가 그린 코딩 고수...jpg [3] ㅇㅇ갤로그로 이동합니다. 19:25 50 0
2871179 나님 수학문제 내면 프갤에서 아무도 못맞춤 ㅇㅅㅇ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 19:25 21 0
2871178 지인 우연히 마주쳤는데 돈 얼마나 범?? [2] 프갤러(124.50) 19:23 36 0
2871177 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 19:22 15 0
2871175 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 19:14 14 0
2871173 2재명도 이렇게 되려나 ㅋㅅㅋ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 19:09 19 0
2871171 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 19:04 12 0
2871170 esp32용 구형 macos 에뮬레이터 발명도둑잡기(118.235) 19:01 14 0
2871169 지금까지 구직 사이트를 한 번도 써본 적이 없음. [2] 프갤러(211.234) 18:54 54 0
2871167 큰거 온당! ♥로스트미디어냥덩이♥갤로그로 이동합니다. 18:47 30 0
2871166 인물이 싫더라도 공은 공이고 과는 과인데 진짜 미안한데 두창이는 [1] ㅆㅇㅆ(124.216) 18:46 49 2
2871164 가장 간단한 8비트 6502 브레드보드 컴퓨터 [1] 발명도둑잡기(118.235) 18:43 21 0
2871163 전라도 홍어 기생충 [1] ♥로스트미디어냥덩이♥갤로그로 이동합니다. 18:42 24 0
2871162 이번 상법개정안은 이전에 IMF랑 OECD에서 권고했던 사안인데 ㅆㅇㅆ(124.216) 18:42 29 0
2871161 걍 좌우 떠나서 찢<<그나마 뭐 할려고 하는듯 임기초 괜찮아보이는데 ㅆㅇㅆ(124.216) 18:40 39 1
2871160 애플1 브레드보드 구현 [1] 발명도둑잡기(118.235) 18:38 22 0
2871159 '주학년 & 아스카 키라라' 영상 뜸 ㄷㄷㄷ 프갤러(211.58) 18:38 19 0
2871157 앞에 부러운 커플이 있네 [2] 발명도둑잡기(118.235) 18:33 39 0
2871156 '김계란 얼굴 공개했네요ㅋㅋ 프갤러(211.58) 18:29 31 0
2871155 씹덕 학원물 청춘 애니 보고 있는데 [2] 아스카영원히사랑해갤로그로 이동합니다. 18:29 44 0
2871152 근데 확실한 건 윤보다 찢이 낫다는 거임 [3] 아스카영원히사랑해갤로그로 이동합니다. 18:17 65 0
뉴스 지드래곤, 8월 방콕 콘서트 취소 디시트렌드 07.11
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2