server {
listen ;
listen ssl;
server_name localhost;
       #ssl on;
ssl_certificate /usr/local/Tengine/sslcrt/linuxyan.com.crt;
ssl_certificate_key /usr/local/Tengine/sslcrt/linuxyan.com.key;
}

把ssl on这行注释掉,ssl写在443端口后面。这样http和https的链接都可以用

nginx配置http和https共存的更多相关文章

  1. Windows下Nginx配置SSL实现Https访问(包含证书生成)

    Vincent.李   Windows下Nginx配置SSL实现Https访问(包含证书生成) Windows下Nginx配置SSL实现Https访问(包含证书生成) 首先要说明为什么要实现https ...

  2. Centos7.2下Nginx配置SSL支持https访问(站点是基于.Net Core2.0开发的WebApi)

    准备工作 1.基于nginx部署好的站点(本文站点是基于.Net Core2.0开发的WebApi,有兴趣的同学可以跳http://www.cnblogs.com/GreedyL/p/7422796. ...

  3. 使用SSL安全证书和nginx配置将域名HTTPS化

    一.在阿里云后台申请免费版证书: 二.在域名解析里面添加记录: 三.提交审核: 四.等待审核通过后,下载nginx证书: 五.按照文档修改nginx配置文件: https://help.aliyun. ...

  4. linux下nginx配置ssl证书(https)

    nginx配置ssl很简单,首先需要两个文件,一个是crt文件,另一个是key文件,如下所示: xxx.crt;  #(证书公钥)xxx.key; #(证书私钥) 把这两个文件放到nginx的conf ...

  5. nginx配置自签名https

    nginx配置https是需要CA颁发证书的,为了测试方便,我们可以使用自签名证书 1.如何生成自签名证书 1.1:我们需要为服务端和客户端准备私钥和公钥: //生成服务器端私钥 openssl ge ...

  6. nginx 配置多个 https 域名访问

    需要此操作的原因 在服务器上部署了 halo blog 以后,这次需要部署另外一个项目,但是又不想使用 ip + port,因此选择使用 nginx 配置多个域名访问. nginx 配置 server ...

  7. 阿里云Center OS 6.2 Nginx 配置 SSL/TLS HTTPS配置

    1.通过https://www.startssl.com/ 免费SSL证书 STARTSSL 跟VeriSign一样,StartSSL(网址:http://www.startssl.com,公司名:S ...

  8. nginx配置-http和https

    #user nobody;worker_processes 1;error_log logs/error.log;#error_log logs/error.log notice;#error_log ...

  9. windows:nginx配置http、https反向代理

    一.下载 Windows 版本的 nginx nnginx下载:http://nginx.org/en/download.html 推荐稳定版本.下载完成后,解压得到 nginx-1.14.0 ,我把 ...

随机推荐

  1. linux CPU动态调频【转】

    转自:https://www.xuebuyuan.com/2185926.html 针对sep4020的linux低功耗研究也有一段时间了,基本把低功耗的实现方式想清楚了(主要分成机制和策略),这段时 ...

  2. aiojobs

    import asyncio import aiojobs async def coro(timeout): print(timeout) await asyncio.sleep(timeout) p ...

  3. win32编程中消息循环和WndProc()窗口过程函数

    原文地址:https://blog.csdn.net/zxxSsdsd/article/details/45504383 在win32程序的消息循环函数中  while (GetMessage (&a ...

  4. hibernate框架学习之增删改查helloworld

    插入数据删除数据修改数据查询单条数据查询多条数据 HelloWorldApp.java package cn.itcast.h3.helloworld; import org.hibernate.Se ...

  5. codeforces 416div.2

        A CodeForces 811A Vladik and Courtesy   B CodeForces 811B Vladik and Complicated Book   C CodeFo ...

  6. simulate events

    windows system maintains a msg queue, and any process that supports msg will create an thread that h ...

  7. linux dynamic lib

    // test1.h ; struct AA { int a,b: }; AA b(5,6); int ball(); // test1.cpp # include"test1.h" ...

  8. encoding and Endian

    Unicode, Code Point is the value of evry character in Unicode table(int,long,ll) Unicode defines a c ...

  9. python 基础 列表

    1.列表list()方法用于将元组转换为列表,[]组成,中间可以放很多内容,每一项使用逗号隔开,列表中可以放置任何数据类型的数据.注:元组与列表是非常类似的,区别在于元组的元素值不能修改,元组是放括号 ...

  10. 【原创】大叔经验分享(40)hdfs关闭kerberos

    hadoop.security.authentication: Kerberos -> Simple hadoop.security.authorization: true -> fals ...