服务配置
server{
listen 443;
server_name idreamsky.net www.idreamsky.net;
ssl on;
root html;
index index.html index.htm;
ssl_certificate cert/idreamsky.net.pem;
ssl_certificate_key cert/idreamsky.net.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM- SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location /static {
alias /home/dreamsky/apps/iDreamSkyBlog/collectedstatic;
}
location / {
proxy_set_header Host $host;
proxy_pass http://127.0.0.1:8888;
}
}
HTTP自动转为HTTPS访问
server{
charset utf-8;
listen 80;
server_name idreamsky.net www.idreamsky.net;
rewrite ^(.*) https://$server_name$1 permanent;
}