配置nginx支持Https一定要先使用stop停止nginx然后重新代开不能使用reload

一:安装letsencrypt

1.从git上克隆下来
git clone https://github.com/letsencrypt/letsencrypt.git
2.切换到letsencrypt中
cd letsencrypt/

执行以下的命令(A/C)

./certbot-auto certonly --standalone --email 邮箱 -d 网址

成功后返回结果

二:nginx配置

  

      server {
listen ;
#强制从http跳转到https
server_name 域名;
rewrite ^(.*) https://$server_name$1 permanent;
} server {
#暴露给外部访问的端口
listen ;
ssl on; ssl_certificate /etc/letsencrypt/live/域名/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/域名/privkey.pem; ssl_session_timeout 5m; ssl_protocols SSLv2 SSLv3 TLSv1 TLSv1.;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on; server_name 域名;
charset utf-;
location / {
include uwsgi_params;
#外部访问80就转发到内部8000
uwsgi_pass 127.0.0.1:;
}
}

配置nginx支持Https的更多相关文章

  1. CentOS 中 配置 Nginx 支持 https

    一.基础设置: .yum -y update .yum -y install openssl* .cd /usr/local/nginx/conf .mkdir ./ssl .cd ./ssl # 在 ...

  2. windows下搭建nginx服务器及实现nginx支持https配置流程

    最近刚接触到了tomcat结合nginx做网站的负载均衡.之前对tomcat搭配nginx实现负载均衡也写过,在上一篇的博客中,最近遇到的问题是要在http的基础上支持https.也就是支持加密的请求 ...

  3. Linux - 配置php-fpm 以及 配置nginx支持php

    配置php-fpm [root@localhost php7]# which php-fpm /usr/local/php7/sbin/php-fpm [root@localhost php7]# p ...

  4. LNMP搭建04 -- 配置Nginx支持PHP

    首先建立存放网页文件的目录,执行 mkdri /usr/local/server/www  然后进入到该目录中 cd /usr/local/server/www 然后创建一个测试文件: phpinfo ...

  5. centos下配置nginx支持php

    添加nginx 默认主页index.php vim .../etc/nginx/conf.d/default.conf location / { root   /usr/share/nginx/htm ...

  6. Ubuntu下安装LNMP之php7的安装并配置Nginx支持php及卸载php

    据了解,php7是比之前的版本性能快很多的.http://php.net/get/php-7.2.2.tar.gz/from/a/mirror 安装前也可提前将相关依赖库安装好,或者在安装php时若安 ...

  7. Linux下安装php环境并且配置Nginx支持php-fpm模块[www]

    Linux下安装php环境并且配置Nginx支持php-fpm模块 http://www.cnblogs.com/freeweb/p/5425554.html 5分钟搭建 nginx +php --- ...

  8. Nginx安装配置|Nginx反向代理|Nginx支持HTTPS|Nginx重定向

    Nginx安装配置 可以直接看到最下面的HTTPS. Nginx安装 我的系统如下: No LSB modules are available. Distributor ID: Ubuntu Desc ...

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

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

随机推荐

  1. 1625 codevs数字金字塔

    1625 数字金字塔 USACO  时间限制: 1 s  空间限制: 128000 KB  题目等级 : 黄金 Gold 题解   题目描述 Description 考虑在下面被显示的数字金字塔. 写 ...

  2. python的编解码问题

    http://blog.chinaunix.net/uid-27838438-id-4227131.html

  3. 运行flask程序

    Command Line Interface Installing Flask installs the flask script, a Click command line interface, i ...

  4. Mysql事件的创建和使用

    1.查看事件是否开启SHOW VARIABLES LIKE 'event_scheduler'; 2.开启事件SET GLOBAL event_scheduler = ON; 3.创建事件DELIMI ...

  5. 杂项:Grunt

    ylbtech-杂项:Grunt GRUNTJavaScript 世界的构建工具 1. 返回顶部 1. 为何要用构建工具? 一句话:自动化.对于需要反复重复的任务,例如压缩(minification) ...

  6. 【转】MEAN:Nodejs+express+angularjs+mongodb搭建前端项目框架NJBlog

    http://www.cnblogs.com/mz121star/archive/2013/03/13/njblog.html 项目地址:https://github.com/mz121star/  ...

  7. linux uid/euid/suid

    Each UNIX process has 3 UIDs associated to it. Superuser/root is UID=0. UID Read UID. It is of the u ...

  8. 升级 AngularJS 至 Angular

    Victor Savkin 大神撰写了一系列文章详细介绍如何升级 AngularJS 应用: NgUpgrade in Depth Upgrade Shell Two Approaches to Up ...

  9. 第三章 Java程序优化(待续)

    字符串优化处理 String对象及其特点 String对象是java语言中重要的数据类型,但它并不是Java的基本数据类型.在C语言中,对字符串的处理最通常的做法是使用char数组,但这种方式的弊端是 ...

  10. paramiko监控 windows服务器 被监控服务器只需要安装openssh服务即可基于wmic完成大部分监控

    #!/usr/bin/python #-*- coding: UTF-8 -*- #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ...