我的http转换成https的nginx配置

作者:Master易
时间:于 2020年4月24日 12:36 创建, 2020年6月12日 07:09 最后一次的修改
浏览:59

server {
  charset utf-8;
  listen 443 ssl; 
  server_name masteryi.top; 
  ssl_certificate 1_masteryi.top_bundle.crt; 
  ssl_certificate_key 2_masteryi.top.key; 
  ssl_session_timeout 5m;
  ssl_protocols TLSv1 TLSv1.1 TLSv1.2; 
  ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; 
  ssl_prefer_server_ciphers on;
  location /static {
    alias /home/sites/173.82.120.157/MasterYi_Django_blog/collected_static;
  } 
  location /favicon.ico {
    alias /home/sites/173.82.120.157/MasterYi_Django_blog/collected_static/favicon.ico;
  } 
  location /media {
    alias /home/sites/173.82.120.157/MasterYi_Django_blog/media;
  }
  location / {
    proxy_set_header Host $host;
    proxy_pass http://unix:/tmp/173.82.120.157.socket;  #       IP
  }
}
server {
  charset utf-8;
  listen 80;
  server_name masteryi.top; 
  return 301 https://$server_name$request_uri; 
}




登录后回复

共有0条评论

易大师的动态

   暂时没什么想写的模块了
   咸鱼趴地

2020/06/27

和易大师成为捧油

   QQ: 296053096