假设地址为 https://dev.local
使用
https://github.com/FiloSottile/mkcert 生成自签名证书
```
mkcert dev.local
```
nginx 配置
```
server {
listen 443 ssl http2;
server_name dev.local;
ssl_certificate /usr/local/etc/nginx/certs/dev.local.pem;
ssl_certificate_key /usr/local/etc/nginx/certs/dev.local-key.pem;
location / {
proxy_pass http://127.0.0.1:3000;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-NginX-Proxy true;
proxy_cache_bypass $http_upgrade;
proxy_http_version 1.1;
proxy_redirect off;
add_header Cache-Control no-cache;
}
}
```
修改 hosts
```
127.0.0.1 dev.local
```