zoukankan      html  css  js  c++  java
  • nginx+php 开启https

    nginx 配置如下,配置好重启nginx,不是nginx -s reload,如果还不能访问肯定就是防火墙问题,关闭防火墙再试试。

    我遇到的问题是:我服务器是ecs,域名解析到阿里云复杂均衡的,结果怎么调试都不行,后来才知道阿里的负载均衡证书必须要在阿里上购买,其他的证书都不行,我把域名重新解析到ecs地址后就完全正常了。

    server {
    
      listen 80;
      server_name www.xxx.com;
      rewrite ^(.*)$ https://$host$1 permanent;
    }
    server {
      listen 443 ssl http2;
      server_name www.xxx.com;
      access_log /var/log/nginx/fir-https_access.log main;
      error_log /var/log/nginx/fir-https_error.log error;
      ssl_certificate /data1/www/key/fir.pem;
      ssl_certificate_key /data1/www/key/fir.key;
      ssl_session_timeout 5m;
      ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
      ssl_session_cache shared:SSL:1m;
      ssl_ciphers HIGH:!aNULL:!MD5;
      ssl_prefer_server_ciphers on;
      fastcgi_param HTTPS on;
      fastcgi_param HTTP_SCHEME https;
      root /data1/www/fir;
        location / {
          index index.html index.php;
          #root /data1/www/fir;
          autoindex off;
          }
        location ~ .php(.*)$ {
          fastcgi_pass 127.0.0.1:9000;
          fastcgi_index index.php;
          fastcgi_split_path_info ^((?U).+.php)(/?.+)$;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
          fastcgi_param PATH_INFO $fastcgi_path_info;
          fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
          include fastcgi_params;
    }
    }

  • 相关阅读:
    数据挖掘笔记(2018-03-22发布于知乎)
    使用Graphlab参加Kaggle比赛(2017-08-20 发布于知乎)
    大数据笔记
    2018网易游戏数据挖掘实习生笔试面经
    数据库课程设计之图书借阅管理系统
    居中
    lucene
    eclipse中使用git
    yii
    工作总结
  • 原文地址:https://www.cnblogs.com/zphqq/p/9706097.html
Copyright © 2011-2022 走看看