설정된 모든 도메인은 3000
번 포트로 향해있습니다.
git clone https://github.com/ong-ar/local-ssl-with-nginx.git
cd local-ssl-with-nginx
mkcert is a simple tool for making locally-trusted development certificates.
$ brew install mkcert
$ mkcert -install
$ mkcert -cert-file=./ssl/all.crt -key-file ./ssl/all.key "*.local.kcd.co.kr" "*.local.cashnote.kr"
$ docker-compose up -d
$ echo '127.0.0.1 merlin.local.cashnote.kr kestrel.local.cashnote.kr space.local.kcd.co.kr' | sudo tee -a /etc/hosts
merlin.local.cashnote.kr
kestrel.local.cashnote.kr
space.local.kcd.co.kr
- 위 설정에서는
*.local.kcd.co.kr
*.local.cashnote.kr
서브도메인에 대해서는 인증서가 있다라는 뜻
에디터로 nginx/conf.d/local.cashnote.kr.conf
열고 아래 코드 추가
server {
listen 443 ssl;
server_name merlin.local.cashnote.kr;
location / {
proxy_pass http://host.docker.internal:4000;
}
}
$ docker-compose restart
$ sudo vi /etc/hosts
127.0.0.1 a.local.kcd.co.kr a.local.cashnote.kr
$ mkcert -cert-file=./ssl/all.crt -key-file ./ssl/all.key "*.local.kcd.co.kr" "*.local.cashnote.kr" "*.example.com"
$ docker-compose restart
$ sudo vi /etc/hosts
127.0.0.1 a.example.com
$ mkcert -uninstall
$ brew uninstall mkcert
$ docker-compose down
/etc/hosts
정리