로컬 SSL 적용

설치

설치

brew install nginx

버전

nginx -v

Nginx 설정

/usr/local/etc/nginx/nginx.conf

ROOT 디렉토리

/usr/local/opt/nginx/html

명령어

적용

sudo brew service reload nginx

시작

sudo brew services start nginx 

중지

sudo brew services stop nginx

재시작

sudo brew services restart nginx

SSL 설정

설치

brew insall mkcert

인증서 생성

mkcert -install
mkcert localhost 127.0.0.1

nginx.conf 수정

server {
    listen       443 ssl;
    server_name  localhost;

    ssl on;
    ssl_certificate /Users/park/SSL/localhost+1.pem;
    ssl_certificate_key /Users/park/SSL/localhost+1-key.pem;

    location / {
        root   html;
        index  index.html index.htm;
    }
}