conf配置如下
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name xxx;
# http 跳转 https
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name xxx;
#证书和密钥存放地址
ssl_certificate /project/ssl/xxx_bundle.crt;
ssl_certificate_key /project/ssl/xxx.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_prefer_server_ciphers on;
# 你的页面
location / {
root /project/vue-node-blog/dist;
index index.html index.htm;
}
}
}