nginx 自用配置模板
server {
listen 80;
server_name example.liukersun.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl;
server_name example.liukersun.com;
ssl_certificate /etc/ssl/example.liukersun.com/fullchain.pem;
ssl_certificate_key /etc/ssl/example.liukersun.com/key.pem;
# SSL configuration
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers 'ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384';
# ssl_prefer_server_ciphers on;
# ssl_session_cache shared:SSL:10m;
ssl_session_timeout 10m;
# HSTS (optional)
# add_header Strict-Transport-Security "max-age=31536000" always;
location / {
proxy_pass http://localhost:10086;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
}
}
链接
ln -s /etc/nginx/sites-available/example.liukersun.com /etc/nginx/sites-enabled/
评论区