디시인사이드 갤러리

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

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 85 추천 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/14 - -
AD 디지털 액세서리 기간한정 세일! 운영자 25/07/11 - -
2870941 러스트보다 쉽게 하고자 한다면 러스트만큼의 안전성을 보장할 수 없다 [1] 프갤러(218.154) 07.11 54 0
2870940 짱깨에 나라 넘어가는중 2재명 셰셰 ♥냥덩이♥갤로그로 이동합니다. 07.11 48 0
2870939 rust보다 쉽고 C++ 대체용으로 나왔다는 vale 언어 [1] 발명도둑잡기(118.216) 07.11 71 0
2870938 [대한민국] 장동혁 - 계엄무새 [1] 프갤러(121.172) 07.11 38 0
2870936 나 맨날 일 안함 [1] ㅇㅇ(211.235) 07.11 52 0
2870935 한껏 헤이해진 정의관 ♥냥덩이♥갤로그로 이동합니다. 07.11 42 0
2870934 공부시작 들어가자 [1] 노력하는자갤로그로 이동합니다. 07.11 59 0
2870932 보수 머리밭은 아직도 꽃밭? 선의의 경쟁이라니... 프갤러(121.172) 07.11 55 0
2870931 GPT 가 쌓인게많네 [2] 피자2021갤로그로 이동합니다. 07.11 89 2
2870930 챗GPT 참스승이네 [3] 피자2021갤로그로 이동합니다. 07.11 81 0
2870929 다가닥 다가닥 ㅇㅅㅇ [3] 헤르 미온느갤로그로 이동합니다. 07.11 45 0
2870928 그놈 kde 최신판 속도 비교 [2] 발명도둑잡기(118.216) 07.11 55 0
2870927 태연 ㅇㅅㅇ 헤르 미온느갤로그로 이동합니다. 07.11 37 0
2870926 하루 한 번 헤르미온느 찬양 헤르 미온느갤로그로 이동합니다. 07.11 33 0
2870925 마이크로소프트가 축구, 야구 게임도 팔았구나 발명도둑잡기(118.216) 07.11 28 0
2870924 사무실 선정리 어캐 해야 하냐? [2] illilj갤로그로 이동합니다. 07.11 59 0
2870922 양기 발산 발명도둑잡기(118.216) 07.11 43 0
2870920 나는조현병이야 나는내향적이야 [2] 손발이시립디다갤로그로 이동합니다. 07.11 40 0
2870916 웃흥~ ♥냥덩이♥갤로그로 이동합니다. 07.11 45 0
2870914 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥냥덩이♥갤로그로 이동합니다. 07.11 34 0
2870910 이재명 이 인간이 공공의료 사고 나몰라한다. 넥도리아(223.38) 07.11 59 0
2870908 나 제모함. 사타구니 넥도리아(175.196) 07.11 42 0
2870906 부산 시민 20% 우울 불안 프갤러(183.101) 07.11 60 0
2870905 프갤망했노 ㅇㅇ(222.232) 07.11 44 0
2870903 노트북 추천좀 퍄퍄_갤로그로 이동합니다. 07.11 105 0
2870901 프리랜서도 결국은 비정규직 노동자인데, 창업해야하는데 ㅆㅇㅆ(124.216) 07.11 39 0
2870897 챗gpt 이새끼 뭐냐 ㅇㅇ(211.235) 07.11 85 0
2870896 음기 충전 발명도둑잡기(118.216) 07.11 41 0
2870895 오늘의 발명 실마리: 레트로 게임기용 gmenu2x DOS용으로 포팅 [1] 발명도둑잡기(118.216) 07.11 42 0
2870894 리눅스를 윈도우95 처럼 꾸미 발명도둑잡기(118.216) 07.10 67 0
2870893 요즘 어셈다루다가 [2] 루도그담당(211.235) 07.10 80 0
2870892 술먹으면 보지 냄새 풍기면서 앵기는년들 왤케 많냐 [2] hrin(118.235) 07.10 98 0
2870891 네이버 오픈소스 가이드 발명도둑잡기(118.216) 07.10 80 0
2870890 직장 동료들 너무 무능하다.. [4] ㅇㅇ(121.162) 07.10 110 0
2870889 리버싱 접기로 함 [5] 루도그담당(58.239) 07.10 98 0
2870888 오늘도 책 한권 끝냈군. 내 조테로 문서 풍성해짐 [1] ㅆㅇㅆ(124.216) 07.10 58 0
2870887 매일매일이 한번이라도 실패하면 적자라서 힘들다 ㅆㅇㅆ(124.216) 07.10 58 0
2870886 아일릿 신보 들어본 결과 발명도둑잡기(118.216) 07.10 44 0
2870885 아스카야 프롬프트 엔지니어링 문서 추천해줌 [2] ㅆㅇㅆ(124.216) 07.10 55 2
2870884 [IT산업] Compile 될 수 있는 AI 와 AI 의 신뢰도.. [1] +abcd3421갤로그로 이동합니다. 07.10 62 0
2870883 디씨인싸이드 에러 발명도둑잡기(118.216) 07.10 38 0
2870882 3617번이라고한다 헬마스터갤로그로 이동합니다. 07.10 53 0
2870881 켄트백 그래도 페북 7년있었잖아. ㅆㅇㅆ(124.216) 07.10 41 0
2870880 나님 유튜브 시청하며 ai 공부중 [9] 아스카영원히사랑해갤로그로 이동합니다. 07.10 77 0
2870879 근데 지피티 쓰면 코드 못쓰게 되는게 당연한 수순임. 이건 어쩔수가 없어 [7] ㅆㅇㅆ(124.216) 07.10 135 1
2870878 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ [1] ♥냥덩이♥갤로그로 이동합니다. 07.10 57 0
2870877 아 이제 지피티 없이 개발 못하겠네.. [2] ㅇㅇ(175.197) 07.10 74 1
2870876 마갤은 취향 안맞아서 정갤에서 정신병 뽐내는게 좋아 [2] ㅆㅇㅆ(124.216) 07.10 50 0
2870875 다 깃허브갤로 이사갔네 [2] 프갤러(106.101) 07.10 84 0
2870874 2주동안 하던 문명 한판 끝냈습니다 [4] 아스카영원히사랑해갤로그로 이동합니다. 07.10 58 1
뉴스 ‘불꽃야구니퍼트, 오랜만의 등판 화려하게 장식할 수 있을까? 거세게 부는 바람 속 파이터즈의 운명은? 디시트렌드 07.14
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2