server {
listen ;
listen 443 ssl;
server_name default; index index.html index.php;
root /www/html;
access_log /var/log/nginx/pay.access.log main buffer=32k;
rewrite_log on; more_set_headers 'Server: $server_name';
more_set_headers -s '400 403 404 405 413 414 500 502 503 504' 'Server: $hostname'; # 此处为ssl 配置
ssl_certificate /usr/local/nginx/cert/test.com.crt; # *.crt文件路径
ssl_certificate_key /usr/local/nginx/cert/test.com.key; # *.key文件路径
ssl_session_cache shared:SSL:128m;
ssl_session_timeout 10m; location ~ \.php$ {
fastcgi_pass 127.0.0.1:;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
include fastcgi_params;
} location = /favicon.ico {
log_not_found off;
access_log off;
}
}

Nginx 配置https 开启ssl 同时支持http的更多相关文章

  1. [nginx][tls] nginx配置https与ssl/tls的sni的方法

    一 https的sni配置方法 http {       }       server {               listen 443 ssl;               server_nam ...

  2. 【转】Linux下nginx配置https协议访问的方法

    一.配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/ ...

  3. nginx配置https双向验证(ca机构证书+自签证书)

    nginx配置https双向验证 服务端验证(ca机构证书) 客户端验证(服务器自签证书) 本文用的阿里云签发的免费证书实验,下载nginx安装ssl,文件夹有两个文件 这两个文件用于做服务器http ...

  4. nginx配置https及Android客户端访问自签名证书

    前一篇随笔通过keytool生成keystore并为tomcat配置https,这篇随笔记录如何给nginx配置https.如果nginx已配置https,则tomcat就不需要再配置https了.通 ...

  5. Nginx 配置 HTTPS 服务器

    Nginx 配置 HTTPS 服务器 Chrome 浏览器地址栏标志着 HTTPS 的绿色小锁头从心理层面上可以给用户专业安全的心理暗示,本文简单总结一下如何在 Nginx 配置 HTTPS 服务器, ...

  6. nginx 配置https没有ssl_module以及一些错误

    一:开始Nginx的SSL模块 1.1 Nginx如果未开启SSL模块,配置Https时提示错误 1 nginx: [emerg] the "ssl" parameter requ ...

  7. nginx 配置https并自签名证书

    2016-10-28 转载请注明出处:http://daodaoliang.com/ 作者: daodaoliang 版本: V1.0.1 邮箱: daodaoliang@yeah.net 参考链接: ...

  8. [记录]NGINX配置HTTPS性能优化方案一则

    NGINX配置HTTPS性能优化方案一则: 1)HSTS的合理使用 2)会话恢复的合理使用 3)Ocsp stapling的合理使用 4)TLS协议的合理配置 5)False Start的合理使用 6 ...

  9. 购买https证书以及nginx配置https

    文章来源 运维公会:购买https证书以及nginx配置https 1.https的作用 https的全名是安全超文本传输协议,是在http的基础上增加了ssl加密协议.在信息传输的过程中,信息有可能 ...

随机推荐

  1. swoole异步redis安装前置条件和流程

    ---恢复内容开始--- 1.redis服务 确认redis在服务器中已经安装了 2.hiredis库 第二步安装hiredis 下载位置 2.1获取 安装包https://github.com/re ...

  2. 关于“C++语言程序设计”书的一个类

    class book{    char* title;    int num_pages;    int cur_page;public:    book(const char* theTitle, ...

  3. Android Jni(Java Native Interface)笔记

    首先记录一个问题,关于如何用javah生成头文件. 为什么要生成头文件?在含有 static{ System.loadLibrary("hellojni"); } 这样代码的类下面 ...

  4. SQL 维护计划(自动删除备份文件)

    --开启修改配置功能 exec sp_configure 'allow updates', 0 --启用功能 sp_configure 'xp_cmdshell',1; reconfigure --临 ...

  5. jQuery.ajax各种参数及属性设置

      $.ajax({       type: "post",       url: url,       dataType:'html',       success: funct ...

  6. 爬虫中Xpath有时候是无效的

    http://www.cnblogs.com/lchzls/p/6282790.html给出了两种方案

  7. vue中使用chart.js

    1,安装chart.js和vue-chart.js npm install chart.js --save npm install vue-chart.js --save 2,独立文件,方便修改 封装 ...

  8. Linux下更改mysql版本

    想要更改linux的mysql版本,并不需要重装系统重新选择mysql版本,只需要删除掉原来的mysql然后在安装新的就可以啦 (谨记:一定要做好数据库备份) 详情请参照:大牛博客 over!over ...

  9. layui 关闭当前窗口,刷新父级页面

    关闭当前窗口 layer.close(layer.index); 刷新页面 window.parent.location.reload();

  10. Unity的http通信--unity与python的django通信

    http://blog.csdn.net/chenggong2dm/article/details/17372203 写在前面: WWW类,是unity里,简单的访问网页的类.本文介绍的就是这种方式, ...