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;
}
}

nginx+php 开启https的更多相关文章

  1. apache和nginx开启https

    1.安装mod_ssl和openssl yum -y install mod_ssl openssl 2.建立服务器密钥 mkdir /etc/httpd/conf.d/ssl.key/ cd /et ...

  2. Nginx安装SSL证书,开启HTTPS加密

    效果就是访问博客的时候出现一把小绿锁,更加安(好)全(看). 实现步骤如下: 申请SSL证书 阿里云可以申请一年的免费证书,下载到本地 上传证书到服务器 scp [文件名] root@[ip地址]:/ ...

  3. Django开启https(不用nginx)

    首先安装需要用到的包 pip install django-extensions pip install django-werkzeug-debugger-runserver pip install ...

  4. 网站开启https后加密协议始终是TLS1.0如何配置成TLS1.2?

    p { margin-bottom: 0.1in; line-height: 120% } 网站开启https后加密协议始终是TLS1.0如何配置成TLS1.2? 要在服务器上开启 TLSv1.,通常 ...

  5. 分享一个免费SSL证书申请网站,给网站开启https协议 | 张戈博客

    这些天,由于公司的业务需求,接触到了ssl证书和https协议.博客前几篇文章也分享了在WEB服务器上安装SSL证书,为网站开启https协议的教程,感兴趣的童鞋可以前往查看相关文章: <Lin ...

  6. Nginx上部署HTTPS

    Nginx上部署HTTPS依赖OpenSSL库和包含文件,即须先安装好libssl-dev,且ln -s /usr/lib/x86_64-linux-gnu/libssl.so  /usr/lib/, ...

  7. Nginx上部署HTTPS + HTTP2

    Nginx上部署HTTPS依赖OpenSSL库和包含文件,即须先安装好libssl-dev(或者OpenSSL),且ln -s /usr/lib/x86_64-linux-gnu/libssl.so ...

  8. 七牛云存储上传自有证书开启https访问

    虽然七牛云存储也提供免费SSL证书申请,但我就喜欢用其他平台申请的,于是在腾讯云申请了免费SSL证书,正准备在七牛上传,弹出的界面却让我傻了眼,如下图所示: 腾讯免费SSL证书提供了不同服务器环境的版 ...

  9. WordPress整站轻松开启HTTPS

    近两年来HTTPS取代HTTP已经成为大势所趋.早在2014年google Chromium安全团队提议将所有的HTTP协议网站标注为不安全.现在,Chrome浏览器已经开始执行这一标准了.从 Chr ...

随机推荐

  1. random模块常用功能

  2. servlet简单的小例子

    去我云盘下载: https://pan.baidu.com/s/1E2yoZ2Nmk2FE2XjuPOCvjA 访问方式:http://localhost:8080/testServlet/index ...

  3. [UE4]场景加载界面

    就可以这样就可以了,当另外一个场景成功打开后,场景加载界面也会自动消失(因为这是加载界面是添加到当前场景). 加上delay是为了在小场景测试的时候可以方便看到加载场景,避免场景加载过快看不到,不加的 ...

  4. 阿里云直播服务 sdk demo php

    [php] <?php /** * Created by PhpStorm. * User: Administrator * Date: 2016/12/8 0008 * Time: 11:05 ...

  5. MySQL之 Mysqldump导出数据库

    参数大全 参数说明 --all-databases , -A 导出全部数据库. mysqldump -uroot -p --all-databases --all-tablespaces , -Y 导 ...

  6. python类型强转&二级容器

    Number 类型强转 int :         ---->>>   float,  bool,  complex,  str Float :        ---->> ...

  7. Session establishment complete on server 2181, sessionid = 0x35fb853eb6f0004

    描述:windows调试 hbase 代码时,出现如下错误:Session establishment complete on server 2181, sessionid = 0x35fb853eb ...

  8. mysql中min和max查询优化

    mysql max() 函数的需扫描where条件过滤后的所有行: 在测试环境中重现: 测试版本:Server version:         5.1.58-log MySQL Community ...

  9. win10安装tomcat9

    环境:win10 64bit.tomcat 时间:2016年9月6日 15:11:47 一.下载tomcat 用浏览器打开tomcat官网:http://tomcat.apache.org/ 在左侧的 ...

  10. 零基础学习python_文件(28-30课)

    本人小白一枚,随着现在对测试要求越来越高,动不动就要去会一门编程语言,没办法只能学习学习Python,今天看到几个月前还是菜鸟的人突然就已经能使用Python写简单系统了,没办法,虽然之前也简单学习过 ...