디시인사이드 갤러리

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

갤러리 본문 영역

Nginx Proxy Manager 질문이요 ㅠ

프갤러(1.236) 2025.07.09 20:56:17
조회 69 추천 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 45394 65
2871089 ..!! ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:58 2 0
2871088 냥덩이를 현실에서 만나고 싶다면? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:40 9 0
2871087 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:13 6 0
2871086 2재명 짱깨 셰셰 ♥로스트미디어냥덩이♥갤로그로 이동합니다. 08:12 6 0
2871085 도로도로도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07:55 9 0
2871083 도로도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07:30 8 0
2871082 도로? ♥로스트미디어냥덩이♥갤로그로 이동합니다. 07:20 9 0
2871081 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥로스트미디어냥덩이♥갤로그로 이동합니다. 06:58 10 0
2871080 자전거 ㅇㅅㅇ 헤르 미온느갤로그로 이동합니다. 06:56 9 0
2871079 태연 ㅇㅅㅇ 헤르 미온느갤로그로 이동합니다. 06:50 8 0
2871078 하루 한 번 헤르미온느 찬양 헤르 미온느갤로그로 이동합니다. 06:48 12 0
2871077 나는조현병이야 나는내향적이야 손발이시립디다갤로그로 이동합니다. 06:09 11 0
2871072 음기 충전 발명도둑잡기(118.216) 01:47 28 0
2871071 디시클리너 프갤러(118.130) 01:43 16 0
2871069 d-bus 라이센스 발명도둑잡기(118.216) 01:37 14 0
2871067 이런 경우엔 어떻게 하는게 좋음? ㅇㅅㅇ [2] 익명의따당이갤로그로 이동합니다. 01:28 54 0
2871066 Github 갤러리 31일 차단 당했다. 발명도둑잡기(118.216) 01:19 40 1
2871065 도스에서 vesa vbe 지원하게 에뮬레이션 발명도둑잡기(118.216) 01:16 20 0
2871063 전국민 다 아는데 서로만 모르는 관계 발명도둑잡기(118.216) 00:49 15 0
2871062 요즘 모기가 잘 안 보이는 이유 [2] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 00:46 35 0
2871061 모기인줄 알고 잡았더니.. [5] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 00:41 40 0
2871060 외국인 혐오선동 규탄 집회 발명도둑잡기(118.216) 00:28 15 0
2871058 나는 일본 만화풍 얼굴만 봐도 짜증이 확 나지만 발명도둑잡기(118.216) 00:13 24 0
2871057 프로미스 상표권 관련 팩트 ㅇㅇ(175.223) 00:09 33 0
2871056 깃허브 프로젝트 setting 어디서 함? 프갤러(180.231) 00:06 14 0
2871055 냥덩이에게 팩폭 일침 발명도둑잡기(118.216) 00:05 18 0
2871054 오늘은 제로 카피 공부하다 자야긋다 ㅆㅇㅆ찡갤로그로 이동합니다. 00:02 23 0
2871053 한녀에게 오염된 모모링이 천연 귀여움을 잃어버리는 과정.. ㅠㅅ ㅠ.. [3] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 00:00 26 0
2871052 한국의 미래 <엑소더스 재팬> [1] 발명도둑잡기(118.216) 07.11 16 0
2871051 러스트는 개발의 즐거움을 포기하게 만드는 언어다 루비갤로그로 이동합니다. 07.11 36 0
2871049 림월드 같은 시뮬겜 만들기 어렵나 [1] 뉴진파갤로그로 이동합니다. 07.11 23 0
2871048 허니패밀리-남자 이야기 [1] 발명도둑잡기(118.216) 07.11 16 0
2871047 그리스 고대 원형극장 소리 발명도둑잡기(118.216) 07.11 11 0
2871046 59.14 임마 빡고수네 [10] ㅆㅇㅆ(124.216) 07.11 72 0
2871045 현존하는 모든 운영체제 뚫는 밀리터리 그레이드 백도어 취약점 [1] 발명도둑잡기(118.216) 07.11 33 0
2871044 러스트 빠돌아 내가 2022년, 2023년 뭐라 했냐. 인생 낭비라 했지 [8] 루비갤로그로 이동합니다. 07.11 34 0
2871043 무자막 케이온 정주행 수련 on [2] 아스카영원히사랑해갤로그로 이동합니다. 07.11 19 0
2871042 나님 누엇어양⭐+ [1] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 07.11 23 0
2871041 dbus 소스코드 봤어? 내부적으로 SO_PEERCRED 사용하잖아. 루비갤로그로 이동합니다. 07.11 20 0
2871040 농부가 된 임베디드 프로그래머 [1] 발명도둑잡기(118.216) 07.11 22 0
2871039 제미니 교육시키는 중 ㅎㅎ ㅁㅌ겟다 루비갤로그로 이동합니다. 07.11 21 0
2871037 나님 소통합니당 질문질 받웅⭐+ [1] ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 07.11 23 0
2871036 나님 왤케 특별하실깡? ♥천상천하유아독존경화수월냥덩♥갤로그로 이동합니다. 07.11 21 0
2871035 한가인이 남편에게 절대 하지 않는다는 것 발명도둑잡기(118.216) 07.11 35 0
2871034 네, 오늘 다국어 입력기 설계를 주제로 나눈 대화를 요약해 드리겠습니다. [1] 루비갤로그로 이동합니다. 07.11 41 0
2871033 돌대가리 제미니.. 궤변을 늘어놓네 [1] 루비갤로그로 이동합니다. 07.11 37 0
2871032 보통 TCP 4계층에서 바이트 기반이라고 표현하지 않나 [2] ㅆㅇㅆ(124.216) 07.11 50 0
2871031 ❤✨☀⭐⚡☘♥+나님 시작합니당♥+☘⚡⭐☀✨❤ ♥냥덩이♥갤로그로 이동합니다. 07.11 18 0
2871030 골때리는 제미니 ㅎㅎ 루비갤로그로 이동합니다. 07.11 18 0
뉴스 지드래곤, 8월 방콕 콘서트 취소 디시트렌드 07.11
갤러리 내부 검색
제목+내용게시물 정렬 옵션

오른쪽 컨텐츠 영역

실시간 베스트

1/8

뉴스

디시미디어

디시이슈

1/2