Nginx Proxy Manager
Docker container and built in Web Application for managing Nginx proxy hosts with a simple, powerful interface, providing free SSL support via Let's Encrypt
nginxproxymanager.com
0. 도커 설치
https://docs.docker.com/desktop/setup/install/mac-install/
Mac
Install Docker for Mac to get started. This guide covers system requirements, where to download, and instructions on how to install and update.
docs.docker.com
도커 설치(버전) 확인
docker -v
1. Docker Compose 파일 생성
services: app: container_name: nginx-proxy-manager image: 'jc21/nginx-proxy-manager:latest' restart: unless-stopped ports: - '80:80' - '81:81' - '443:443' volumes: - ./data:/data - ./letsencrypt:/etc/letsencrypt
위 파일은 공홈 QuickGuide대로입니다.
docker-compose.yml를 원하는 곳으로 설치(경로는 영어로)
docker-compose.yml을 저장한 경로에서 명령어 실행
docker-compose up -d
정상적으로 올라갔는지 확인
docker container ls -all
명령어 혹은 OrbStack, Docker Desktop 같은 것으로 확인..
2. Nginx Proxy Manager 접속
접속 URL은 "http://localhost:81"로 접속하면 된다.

초기 계정
- Email: admin@example.com
- Password: changeme
초기 계정으로 접속시 이름, 닉네임, 이메일, 패스워드를 변경하는 팝업이 뜸.
3. Host 설정



Domain Names: 오픈할 서버 URL 입력 (ex: localhost, local.test.com)
Scheme: 내부 웹 서비스 프로토콜 (http or https)
Forward Hostname / IP: 내부 웹 서비스 IP나 호스트 이름 (host.docker.internal)
Forward Port: 내부 웹 서비스 포트(80, 81, 443은 Nginx Proxy Manager에게 할당되어 있음)
Cache Assets: 정적 콘텐츠 캐싱 기능
Block Common Exploits: 프로젝트에서 제공하는 공격 패턴 차단 기능
SQL Injection을 막아주는 기능
Websockets Supoort: 웹 소켓 기능
3-1. Custom locations 설정

저는 백엔드를 3002포트로 열어서 위와 같이 설정했습니다.
Define location: 구분되는 router명
Scheme: 내부 웹 서비스 프로토콜 (http or https)
Forward Hostname / IP: 내부 웹 서비스 IP나 호스트 이름
Forward Port: 내부 웹 서비스 포트
3-2. SSL Certificates 등록 (Https 사용시)
저는 mkcert를 사용하여 localhost용 인증서를 사용할 예정입니다.



인증서 등록시 Name은 구분할 수 있게 잘 적어야한다. (수정 불가)

inactive 상태는 proxy host에 연결되지 않은 상태일 뿐, 정상 등록된 화면입니다.
3-3. Proxy Hosts에 SSL 설정하기




Force SSL: HTTP 프로토콜(Port: 80)로 접속해도 HTTPS 프로토콜 (Port: 443)로 접근시키도록 하는 기능
HTTP/2 Support: HTTP/2 프로토콜 사용
기존 HTTP 표준을 확장한 프로토콜이며, 성능이 개선된 방식
HSTS Enabled: HTTP Strict Transport Security
웹 서비스를 보안 연결을 통해서만 접속되도록 강제하는 정책
HSTS Subdomains: HSTS 정책을 모든 하위 도메인에도 적용시키기 위함
Request a new SSL Certificate 선택시 나오는 추가옵션

Use a DNS Challenge: Let's Encrypt SSL 인증서를 발급받기 위한 방식 중 하나로 도메인 소유권을 검증하기 위해 HTTP 챌린지를 사용함. (DNS 설정을 건드릴 수 있어야함)
DNS Provider: 도메인 이름을 IP 주소로 변환해주는 서비스를 제공하는 업체
