디시인사이드 갤러리

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

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 307 추천 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/12/08 - -
이슈 [디시人터뷰] 솔직함을 리뷰하는 유튜버, 흑백리뷰 운영자 25/12/09 - -
AD AI 가전 디지털 모음전 운영자 25/11/27 - -
공지 프로그래밍 갤러리 이용 안내 [98] 운영자 20.09.28 48872 65
2907600 신입개발자 오늘 한 일.list [1] cvs.갤로그로 이동합니다. 21:50 16 0
2907599 “소보로빵 하나에 3천원, 이유 좀 압시다”…검찰, 밀가루 회사 5곳 털 발명도둑잡기(118.216) 21:48 10 0
2907598 마취 없는 절단→임산부 실험…인간 생체실험 고발 '731' 개봉 발명도둑잡기(118.216) 21:44 9 0
2907597 김충길 고백 공격, 영화가 시작됐다…감독 류현경의 도전 발명도둑잡기(118.216) 21:42 8 0
2907596 민주당 이재명 정권이 국가보안법 철폐를 한다면 역사책에 남을 것이다 발명도둑잡기(118.216) 21:34 9 0
2907595 예전에 영포티 새기들한테 매뉴얼 만들어서 인계 내리면 [4] 프갤러(49.165) 21:17 33 1
2907594 ai로 실사화 한 조선시대 그림들 발명도둑잡기(118.216) 21:07 9 0
2907593 가짜운동하러 왔다 [1] 헬마스터갤로그로 이동합니다. 21:05 14 0
2907592 개좆소 5년차 내년 연봉 협상했다 [3] 프갤러(211.235) 20:23 64 0
2907591 요즘 뭐 재미있는거 없니? [6] cvs.갤로그로 이동합니다. 20:02 39 0
2907590 러스트 어렵진 않은데 [1] 루도그담당(118.235) 19:58 35 0
2907588 갤럭시 트라이폴드 출시하자마자 사야하는 이유.JPG [1] 야옹아저씨갤로그로 이동합니다. 19:27 57 0
2907587 수학 갤러리설정 연관 갤러리(0/21) 갤주소 복사 이용안내 카포에 프갤러(220.70) 19:27 20 0
2907586 https://gall.dcinside.com/mgallery/board 프갤러(220.70) 19:25 15 0
2907585 [대한민국] 21세기 똥자르크 안귀령과 국민의 힘 [2] ㅇㅇ(121.172) 19:18 20 0
2907583 USB 상태 모니터링 LCD 오픈소스 서버 발명도둑잡기(118.216) 19:00 18 0
2907581 ◆컴공과인데 개발자할까 볼보트럭 정비사 할까 [1] ㅇㅇ갤로그로 이동합니다. 18:46 43 0
2907580 쿼리가 주렁주렁 길어진다.. [1] cvs.갤로그로 이동합니다. 18:43 26 0
2907578 [대한민국] 양평 공무원과 노상원 ㅇㅇ(121.172) 17:59 16 0
2907577 C++ 인생 40 년 갈아 넣었습니다. [1] 프갤러(59.16) 17:28 48 0
2907575 천만원 대출남 저격수 넥도리아(223.38) 17:20 15 0
2907573 러스트 못배우면 지능 부족인걸 인정할 줄 알아야 [2] 프갤러(61.74) 16:40 44 0
2907572 sds는 오히려 호황인가?? ai땜에 [1] 프갤러(121.145) 16:12 38 0
2907569 조국혁신당 보유국 나라다ㅋㅋㅋ 타이밍뒷.통수한방(1.213) 15:52 16 0
2907568 모르는 건 모른다, 내 역량이 부족하다고 인정할 줄 알아야 하는데 [13] ㅇㅇ(223.38) 15:44 94 0
2907567 선 넘는 애들 많던데 [2] 프갤러(49.165) 15:34 82 0
2907565 미국은 곧 로마 제국처럼 망한다? [1] 발명도둑잡기(118.216) 15:06 42 0
2907564 The Floppotron 3.0 - Computer Hardware O 발명도둑잡기(118.216) 14:31 16 0
2907563 이건 머고 시발? [3] 프갤러(49.165) 14:26 78 0
2907562 구형 하드디스크 소리 흉내내는 장치, 소프트웨어 발명도둑잡기(118.216) 14:23 28 0
2907561 Steve Ballmer Developers Music Video 발명도둑잡기(118.216) 14:11 15 0
2907560 지하철인데 존예녀 한 명 있더라? 번호딸까? [1] ㅁㅁㅅ갤로그로 이동합니다. 13:52 60 0
2907558 일본 변태물 일본 음란물이 최고임 ㅇㅅㅇ 류류(121.140) 13:26 29 0
2907557 와 깜짝놀랬다. [1] 프갤러(49.165) 13:25 34 0
2907556 조국혁신당이 미래임 조국이 대통령이고 타이밍뒷.통수한방(1.213) 13:17 25 1
2907555 jsp 쓸바엔 러스트 테라 쓰지 [1] 프갤러(27.171) 13:12 51 0
2907554 넥스트 볼수록 드는 생각이 이짓할꺼면 jsp쓰지 ㅇㅇ(182.228) 13:01 31 0
2907553 틈만나면 해킹으로 털리는시대에 간철수가 한마디한적을 본적이없음 타이밍뒷.통수한방(1.213) 12:42 23 0
2907551 좋은 보고는 윗사람이 궁금하지 않게 중간중간 보고하는거야 ㅇ ㅅㅇ [2] 프갤러(60.196) 10:48 64 0
2907549 학교다닐때 이런 괴롭힘 당한적 있는데 나뿐임? [2] ㅁㅁㅅ갤로그로 이동합니다. 10:15 65 0
2907548 프로그래머는 언제 AI로 대체 돼? [2] 프갤러(223.39) 10:12 97 0
2907547 자러감.. ㅇㅅㅇ [2] 헤르 미온느갤로그로 이동합니다. 10:06 33 0
2907546 오늘 아침 퇴근길 ㅇㅅㅇ [3] 헤르 미온느갤로그로 이동합니다. 09:33 59 0
2907545 태연 ㅇㅅㅇ [1] 헤르 미온느갤로그로 이동합니다. 09:32 33 0
2907544 하루 한 번 헤르미온느 찬양 [1] 헤르 미온느갤로그로 이동합니다. 09:30 65 0
2907543 본인 프론트 고민중이다 [1] 프갤러(121.129) 09:29 44 0
2907542 ai한테 쿼리 검수 맡겼더니 ㅇ ㅅㅇ 프갤러(60.196) 08:55 45 0
2907541 회사 어플만들려는데 이런거 외주맡기면 얼마듬?? [5] ㅇㅇ갤로그로 이동합니다. 08:16 72 0
2907540 ❤✨☀⭐⚡☘⛩☃나님 시작합니당☃⛩☘⚡⭐☀✨❤ [2] ♥발라당냥덩♥갤로그로 이동합니다. 07:39 68 0
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

디시미디어

디시이슈

1/2