- 도메인과 서브 도메인이 준비되어 있어야 하며, A 레코드가 올바르게 설정되어 있어야 함
- docker 설치 필수
- ubuntu 24 버전에서 도커 설치되었습니다.
- docker network를 추가해야합니다. -> uponati-network
- command
- docker network create uponati-network
- command
- 성공적인 SSL 인증을 위해, Nginx와 Certbot을 통한 인증서 발급 시 conf 파일에 지정된 백엔드 애플리케이션 컨테이너가 반드시 실행 중이어야 함
- certbot을 지원해주는 버전이 정해져있기 때문에 docker compose version 3.3 이하로 해야한다는 단점이 있다. 그 이상 버전은 오류를 발생한다고 함
(실행 권한이 없을 경우 chmod +x [sh file name] 명령어 사용하세요.)
./init.sh
./append-new-domain.sh
./add-domain.sh
- 도메인 정보(A 레코드 입력)
- SSL에 관련된 안내 메일을 받을 이메일
- 애플리케이션 이름(적절한 이름으로 지정, [Ex. oddnary] )
- 애플리케이션 컨테이너를 띄운 PORTs (Ex. 3000 or 3000, 3001, 3002)
출처 README.md 내용 펼치기
This repository is accompanied by a step-by-step guide on how to set up nginx and Let’s Encrypt with Docker.
init-letsencrypt.sh
fetches and ensures the renewal of a Let’s
Encrypt certificate for one or multiple domains in a docker-compose
setup with nginx.
This is useful when you need to set up nginx as a reverse proxy for an
application..
-
Clone this repository:
git clone https://github.com/wmnnd/nginx-certbot.git .
-
Modify configuration:
- Add domains and email addresses to init-letsencrypt.sh
- Replace all occurrences of example.org with primary domain (the first one you added to init-letsencrypt.sh) in data/nginx/app.conf
-
Run the init script:
./init-letsencrypt.sh
-
Run the server:
docker-compose up
Feel free to post questions in the xcomment section of the accompanying guide
All code in this repository is licensed under the terms of the MIT License
. For further information please refer to the LICENSE
file.