디시인사이드 갤러리

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

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 70 추천 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 45400 65
2871115 고등학생인것 같다는 얘기 들었다 [3] 헬마스터갤로그로 이동합니다. 14:08 15 0
2871114 국비 강사새끼들 다뒤졌네 프갤러(106.102) 13:59 9 0
2871113 트럼프는 슈퍼맨도 이민자라고 추방할 예정 발명도둑잡기(118.216) 13:55 7 0
2871112 성인 넷 중 한 명만 중강도 이상 신체활동…"부족률 세계 1.9배" 발명도둑잡기(118.216) 13:50 11 0
2871111 요즘 코드 짜주는 도우미 AI 중에 쓸만한 것은 뭐있냐 ? ♨2.97™갤로그로 이동합니다. 13:36 9 0
2871110 10만 대기. 궁금한 거 물어봐. 다 대답해줌 [1] 프갤러(121.172) 13:35 11 0
2871109 웹페이지만드는데 궁금한거 있는데 프갤러(211.196) 13:17 17 0
2871107 짱깨좌빨척살 ! ♥로스트미디어냥덩이♥갤로그로 이동합니다. 12:31 15 0
2871105 나님 낮술 때리니 기분이 Joker등여~⭐+ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 11:53 15 0
2871104 웹앱땔깜들 소멸이얼마남지않았다 네오커헠(211.235) 11:48 31 0
2871101 냥덩이❤+가 지배하는 세상⭐+ [3] ♥로스트미디어냥덩이♥갤로그로 이동합니다. 11:03 30 0
2871100 선임 육휴가고 경력자 뽑아서 그자리채웟는데 [7] ㅇㅇ(211.234) 10:58 56 0
2871099 전철에 비실이할머니 개멍청한유라갤로그로 이동합니다. 10:56 26 0
2871098 백종원 보다가 은현장 보니깐 천사가 따로없네 [7] 야옹아저씨갤로그로 이동합니다. 10:36 75 5
2871097 킬링필드의 진실, 그 때 미군 폭격이 있었다 발명도둑잡기(118.216) 10:33 9 0
2871095 고수준 개발자들은 gpu 개비싼거 사서 api키 따로 안씀? ㅇㅇ(119.194) 10:31 31 0
2871094 이게 뭐라고 신기하냐 [1] 프갤러(113.59) 10:26 33 0
2871093 관세폭탄 쳐맞고 술이나 처먹는 무능좌파 2찢명 [1] ♥로스트미디어냥덩이♥갤로그로 이동합니다. 10:17 27 0
2871092 윤석열이 싸지른 똥 이재명이 열심히 치우는 중 [1] 야옹아저씨갤로그로 이동합니다. 09:51 26 0
2871089 ..!! [1] ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:58 22 0
2871088 냥덩이를 현실에서 만나고 싶다면? [2] ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:40 39 0
2871087 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:13 15 0
2871086 2재명 짱깨 셰셰 ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:12 14 0
2871085 도로도로도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07:55 18 0
2871083 도로도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07:30 16 0
2871082 도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07:20 18 0
2871081 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 06:58 15 0
2871080 자전거 ㅇㅅㅇ 헤르 미온느갤로그로 이동합니다. 06:56 12 0
2871079 태연 ㅇㅅㅇ 헤르 미온느갤로그로 이동합니다. 06:50 12 0
2871078 하루 한 번 헤르미온느 찬양 헤르 미온느갤로그로 이동합니다. 06:48 17 0
2871077 나는조현병이야 나는내향적이야 손발이시립디다갤로그로 이동합니다. 06:09 19 0
2871072 음기 충전 발명도둑잡기(118.216) 01:47 35 0
2871071 디시클리너 프갤러(118.130) 01:43 19 0
2871069 d-bus 라이센스 발명도둑잡기(118.216) 01:37 17 0
2871067 이런 경우엔 어떻게 하는게 좋음? ㅇㅅㅇ [2] 익명의따당이갤로그로 이동합니다. 01:28 73 0
2871066 Github 갤러리 31일 차단 당했다. 발명도둑잡기(118.216) 01:19 56 1
2871065 도스에서 vesa vbe 지원하게 에뮬레이션 발명도둑잡기(118.216) 01:16 33 0
2871063 전국민 다 아는데 서로만 모르는 관계 발명도둑잡기(118.216) 00:49 19 0
2871062 요즘 모기가 잘 안 보이는 이유 [2] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 00:46 46 0
2871061 모기인줄 알고 잡았더니.. [5] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 00:41 47 0
2871060 외국인 혐오선동 규탄 집회 발명도둑잡기(118.216) 00:28 19 0
2871058 나는 일본 만화풍 얼굴만 봐도 짜증이 확 나지만 발명도둑잡기(118.216) 00:13 32 0
2871057 프로미스 상표권 관련 팩트 ㅇㅇ(175.223) 00:09 36 0
2871056 깃허브 프로젝트 setting 어디서 함? 프갤러(180.231) 00:06 19 0
2871055 냥덩이에게 팩폭 일침 발명도둑잡기(118.216) 00:05 22 0
2871054 오늘은 제로 카피 공부하다 자야긋다 ㅆㅇㅆ찡갤로그로 이동합니다. 00:02 28 0
2871053 한녀에게 오염된 모모링이 천연 귀여움을 잃어버리는 과정.. ㅠㅅ ㅠ.. [3] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 00:00 33 0
2871052 한국의 미래 <엑소더스 재팬> [1] 발명도둑잡기(118.216) 07.11 23 0
2871051 러스트는 개발의 즐거움을 포기하게 만드는 언어다 [1] 루비갤로그로 이동합니다. 07.11 56 0
뉴스 [집 나가면 개호강] “보조견은 다 대형견인 줄” 강소라도 몰랐다…청각장애인 돕는 ‘보청견’ 등장에 시선 집중! 디시트렌드 07.11
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2