디시인사이드 갤러리

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

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 65 추천 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 - -
공지 프로그래밍 갤러리 이용 안내 [88] 운영자 20.09.28 45366 65
2870966 지금 회사 인턴 나왔는데 대학생 인턴이거든 근데 화재감지이미지를 구하래 프갤러(112.187) 14:12 6 0
2870965 팀에 리액트, 뷰 다룰수 있는 사람있는데 굳이 템플릿 엔진 써야함? [3] ㅇㅇ갤로그로 이동합니다. 14:12 17 0
2870963 응애 애기 개발잔데요 [1] 프갤러(207.81) 13:59 12 0
2870962 현업의 비극은 적성에 안맞는 사람들이 너무 많다는거 프갤러(118.235) 13:57 13 0
2870961 에이다 그거 http 서버는 만들 수 있나? 프갤러(218.154) 13:52 12 0
2870960 재매이햄이 ai 기술 강화한다고 했는데 [1] 루도그담당(211.235) 13:49 16 0
2870959 러스트 때려치고 Ada 해라. 프갤러(59.16) 13:43 16 0
2870958 여기서 말하는 국비가 다 도시쪽에 있는거지? [1] 자르박갤로그로 이동합니다. 13:22 20 0
2870957 할아버지 할머니 젊었을적에 ♥냥덩이♥갤로그로 이동합니다. 13:02 13 0
2870956 인간은 왜 일을하는것인가요 [2] 노력하는자갤로그로 이동합니다. 13:01 32 0
2870955 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥냥덩이♥갤로그로 이동합니다. 13:00 8 0
2870954 LLM때문에 오히려 개발자 CS가 중요해짐 [1] 거북이속이거북갤로그로 이동합니다. 12:57 50 0
2870953 보드는 리눅스인데 코드는 윈도우환경에서 짜는거 흔하냐? 프갤러(118.235) 12:53 15 0
2870952 야근하는순간 퇴사임 [1] ㅇㅇ(211.235) 12:16 30 0
2870951 리눅스/freebsd에서 4k 모니터 문제 없겠지? [5] 루비갤로그로 이동합니다. 12:11 29 0
2870950 포케몬 디스어셈블리 볼때마다 [1] 프갤러(113.59) 12:03 32 0
2870949 러스트에 속지 맙시다 ㅋㅋ [1] 루비갤로그로 이동합니다. 12:00 27 0
2870948 러스트 담론을 해체하다: 4.3 설계 철학 비교 [1] 루비갤로그로 이동합니다. 11:47 21 0
2870947 github 갤러리 관리자 아이디 ya로 끝난다 [1] 발명도둑잡기(118.216) 11:43 26 0
2870946 화웨이가 개발한 창제 언어 [2] 발명도둑잡기(118.216) 11:41 31 0
2870945 체크메이트 모니터 보고 드는 생각 발명도둑잡기(118.216) 11:32 14 0
2870944 SI기업 탑3 중 하나 다니는데 [1] ㅇㅇ갤로그로 이동합니다. 11:32 27 0
2870943 cyclone 언어 발명도둑잡기(118.216) 11:16 29 0
2870942 vale 언어 메모리 설명 발명도둑잡기(118.216) 11:14 17 0
2870941 러스트보다 쉽게 하고자 한다면 러스트만큼의 안전성을 보장할 수 없다 [1] 프갤러(218.154) 11:02 31 0
2870940 짱깨에 나라 넘어가는중 2재명 셰셰 ♥냥덩이♥갤로그로 이동합니다. 10:52 29 0
2870939 rust보다 쉽고 C++ 대체용으로 나왔다는 vale 언어 [1] 발명도둑잡기(118.216) 10:45 32 0
2870938 [대한민국] 장동혁 - 계엄무새 [1] 프갤러(121.172) 10:36 19 0
2870936 나 맨날 일 안함 [1] ㅇㅇ(211.235) 10:22 30 0
2870935 한껏 헤이해진 정의관 ♥냥덩이♥갤로그로 이동합니다. 10:21 25 0
2870934 공부시작 들어가자 [1] 노력하는자갤로그로 이동합니다. 10:07 35 0
2870932 보수 머리밭은 아직도 꽃밭? 선의의 경쟁이라니... 프갤러(121.172) 09:34 38 0
2870931 GPT 가 쌓인게많네 [2] 피자2021갤로그로 이동합니다. 09:17 42 0
2870930 챗GPT 참스승이네 [3] 피자2021갤로그로 이동합니다. 09:09 46 0
2870929 다가닥 다가닥 ㅇㅅㅇ [3] 헤르 미온느갤로그로 이동합니다. 08:09 27 0
2870928 그놈 kde 최신판 속도 비교 [2] 발명도둑잡기(118.216) 08:03 30 0
2870927 태연 ㅇㅅㅇ 헤르 미온느갤로그로 이동합니다. 07:56 19 0
2870926 하루 한 번 헤르미온느 찬양 헤르 미온느갤로그로 이동합니다. 07:53 18 0
2870925 마이크로소프트가 축구, 야구 게임도 팔았구나 발명도둑잡기(118.216) 07:44 17 0
2870924 사무실 선정리 어캐 해야 하냐? [2] illilj갤로그로 이동합니다. 07:14 36 0
2870922 양기 발산 발명도둑잡기(118.216) 06:41 23 0
2870920 나는조현병이야 나는내향적이야 [1] 손발이시립디다갤로그로 이동합니다. 06:17 22 0
2870916 웃흥~ ♥냥덩이♥갤로그로 이동합니다. 06:01 26 0
2870914 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥냥덩이♥갤로그로 이동합니다. 05:47 21 0
2870910 이재명 이 인간이 공공의료 사고 나몰라한다. 넥도리아(223.38) 04:45 35 0
2870908 나 제모함. 사타구니 넥도리아(175.196) 04:14 24 0
2870906 부산 시민 20% 우울 불안 프갤러(183.101) 03:00 30 0
2870905 프갤망했노 ㅇㅇ(222.232) 02:49 31 0
2870903 노트북 추천좀 퍄퍄_갤로그로 이동합니다. 02:02 44 0
뉴스 TIOT(티아이오티), 신곡 ‘맨발의 청춘’ 음방 최초 공개! 디시트렌드 07.10
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2