13-1. 사전 준비

여러가지가 필요하다.

13-2. HTTPS를 지원하는 Reverse Proxy 서버 구축하기

certbot과 nginx

certbot certonly --dry-run --webroot --webroot-path=/usr/share/nginx/html 
--email [email protected] --agree-tos --no-eff-email --keep-until-expiring -d 
fun-coding.xyz -d www.fun-coding.xyz

Untitled

docker compose

version: "3"

services:
  webserver:
    image: nginx:latest
    container_name: **proxy** 
    restart: always
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./myweb:/usr/share/nginx/html
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./certbot-etc:/etc/letsencrypt

  nginx:
    image: nginx:latest
    container_name: myweb
    restart: always
    volumes:
      - ./myweb:/usr/share/nginx/html

  certbot:
    depends_on:
      - webserver
    **image: certbot/certbot # 공식 이미지가 있으므로 가져다 쓰면 된다.** 
    container_name: certbot
    volumes:
      - ./certbot-etc:/etc/letsencrypt
      - ./myweb:/usr/share/nginx/html
    command: certonly --dry-run --webroot --webroot-path=/usr/share/nginx/html --email [email protected] --agree-tos --no-eff-email --keep-until-expiring -d fun-coding.xyz -d www.fun-coding.xyz

https를 위한 EC2 인바운드 규칙 설정

Untitled

인증서 발급 테스트 및 실제 발급