请Scott老师给发一份 nginx 配置文件

来源:13-2 服务器第一次部署与发布

心有猛虎_细嗅蔷薇

2018-05-16

我比对着写

写回答

1回答

Scott

2018-05-16

这是 https 是 nginx 配置


upstream wechatonline {
  server 127.0.0.1:3001;
}
server {
  listen 80;
  server_name wechatonline.iblack7.com;
  #rewrite ^(.*) https://$host$1 permanent;
  return 301 https://wechatonline.iblack7.com$request_uri;
}
server {
  listen 443;
  server_name wechatonline.iblack7.com; #填写绑定证书的域名
  ssl on;
  ssl_certificate /www/ssl/214680368210040.pem;
  ssl_certificate_key /www/ssl/214680368210040.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;
  if ($ssl_protocol = "") {
    rewrite ^(.*) https://$host$1 permanent;
  }
  location / {
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forward-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_set_header X-Nginx-Proxy true;
    proxy_pass http://wechat7online;
    proxy_redirect off;
  }
  location ~* ^.+\.(txt|js|css|ico|json) {
    root /www/wechat7online/public;
  }
  access_log  /www/nginx_logs/wechatonline.log;
}


0
2
Scott
回复
心有猛虎_细嗅蔷薇
可以微信号发我邮箱 wolf18387@qq.com,我微信上给你看看
2018-05-20
共2条回复

Koa2框架从0开始构建预告片网站

Koa2+MongoDB+Parcel+Puppeteer+AntDesign快速搭建预告片网站

751 学习 · 362 问题

查看课程