-
Notifications
You must be signed in to change notification settings - Fork 379
Setup Local SSL
ucan-lab edited this page Jul 7, 2023
·
9 revisions
-
https://github.com/FiloSottile/mkcert
- Create a local SSL certificate tool
-
https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS
- Network Security Services
- Required to enable SSL on localhost in Firefox
$ brew install mkcert nss
$ mkcert -install
-
chrome://flags/#allow-insecure-localhost
-
DISABLED
=>ENABLED
-
$ mkcert -cert-file ./infra/docker/nginx/localhost.pem -key-file ./infra/docker/nginx/localhost-key.pem localhost
Add .gitignore file
$ echo '*.pem' >> ./infra/docker/nginx/.gitignore
services:
web:
ports:
- target: 443
published: 443
protocol: tcp
mode: host
server {
# listen 80;
# listen [::]:80;
listen 443 ssl;
listen [::]:443 ssl;
server_name localhost;
ssl_certificate /etc/nginx/conf.d/localhost.pem;
ssl_certificate_key /etc/nginx/conf.d/localhost-key.pem;
# ...
}
Reference: http://nginx.org/en/docs/http/configuring_https_servers.html
COPY ./infra/docker/nginx/*.pem /etc/nginx/conf.d/
$ docker compose down
$ docker compose build web
$ docker compose up -d