mac → 키체인 접근 → 인증서 지원 -> 인증기관에서 인증서 요청
SSL 인증서를 발급하기 전에, 해당 도메인의 소유주가 맞는 지 확인하는 검증 단계입니다.
도메인 구입 사이트 또는 호스팅 사이트에서 cname 등록인 필요합니다. (ex. aws route53, gabia 등)
하루를 기다려도 검증이 안될 시 잘못 입력한 부분이 있는지 확인해야 합니다.
Type: CNAME Record
Host: CNAME
Value: CNAME value
TTL: Automatic
🚫 주의할점: Host 입력 시 도메인 제거 후 입력할 것!
DNS 검증 완료 시 구매 사이트로부터 다운로드
mac → 키체인 접근 → 도메인 검색(ex. google.com) → 개인키 우클릭 → 내보내기(.p12 파일)
openssl pkcs12 -in your_domain.p12 -nodes -out your_domain.key -nocerts
/etc/ssl/certs/your_domain_chain.crt // 체인
/etc/ssl/certs/your_domain_private.key // 개인키
// /etc/nginx/conf.d/default.conf
server {
listen 80 default_server;
listen [::]:80 default_server;
return 301 https://your_domain$request_uri;
}
server {
listen 443 ssl;
ssl_certificate /etc/ssl/certs/your_domain_chain.crt;
ssl_certificate_key /etc/ssl/certs/your_domain_private.key;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ =404;
}
server_name your_domain www.your_domain;
}
// nginx 문법 테스트
sudo nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
// nginx 재실행
sudo service nginx restart