个人博客如何开启 https
以前写过利用 wordpress 搭建的一个博客『个人博客搭建( wordpress )』,绑定了域名,但是没开启 https,在浏览博客的时候浏览器会提示不安全。下面来谈下个人博客如何免费申请证书,开启 https 。
一、申请 Let's Encrypt 证书
系统环境要求:python2.7+ 手动申请网址:letsencrypt.osfipin.com/v2/login
1、安装 git
yum install -y git
查看版本号:git --version
卸载:yum remove git
2、安装 letsencrypt
git clone https://github.com/letsencrypt/letsencrypt
3、生成证书
在 letsencrypt 目录下执行
./letsencrypt-auto certonly --standalone --email YOUR_EMAIL -d xxx.com --quiet --agree-tos
4、错误处理
rm -rf ~/.pip/pip.conf

PS: no response "Installing Python packages" # vim ~/.pip/pip.conf or vim ~/.config/pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple/
[install]
trusted-host=pypi.tuna.tsinghua.edu.cn
二、配置 nginx
# vim /etc/nginx/nginx.conf
...
http {
...
server {
listen 80;
server_name xxx.com;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name xxx.com;
server_name_in_redirect off;
ssl_certificate "/etc/letsencrypt/live/hirat.online/fullchain.pem";
ssl_certificate_key "/etc/letsencrypt/live/hirat.online/privkey.pem";
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REQUEST-URI $request_uri;
proxy_set_header Cookie $http_cookie;
proxy_pass http://localhost:9090;
proxy_cookie_domain domino.server nginx.server;
proxy_redirect off;
}
}
}
三、启动 nginx
systemctl start nginx.service
浏览器输入:https://xxx.com 看看效果。
特别提醒:上面的方法申请的 Let's Encrypt 免费证书有效期90天的,别忘了续签。
个人博客如何开启 https的更多相关文章
- 利用GitHub搭建Hexo博客并开启HTTPS
Hexo 是一个快速.简洁且高效的博客框架.Hexo 使用 Markdown(或其他渲染引擎)解析文章,在几秒内,即可利用靓丽的主题生成静态网页. GitHub 是一个面向开源及私有软件项目的托管平台 ...
- 我的博客搬家到https://www.w2le.com/了
大家以后想看我的博文的请到这里哦,欢迎大家访问https://www.w2le.com/
- 使用halo搭建自己的博客并配置https域名访问
首先进行java配置 # 1. 下载jdk [下载地址](https://www.oracle.com/cn/java/technologies/javase-downloads.html) - 一定 ...
- 在GitHub搭建个人博客 地址: https://douzujun.github.io/
搭建博客地址:https://douzujun.github.io/ 博客模板:https://github.com/douzujun/douzujun.github.io 显示效果:
- 使用Coding.net+Hexo+node.js+git来搭建个人博客
使用Coding.net来搭建基于Hexo的博客 一.准备工作 什么是Coding.net Coding可以说,就是国产的Github,但是,有一个功能使它似乎超越了GitHub-那就是 Web ID ...
- Git+Hexo搭建个人博客详细过程
通过Git+Hexo搭建的个人博客地址:https://liangh.top/ 1.安装Node.js.配置好Node.js环境.安装Git和配置好Git环境,打开cmd命令行,成功界面如下 2.安装 ...
- github+hexo搭建博客
引言 之前用阿里云弹性web托管采用wordpress搭建的个人博客,经过我使用一段时间之后发现存在很多问题: 网站的响应速度非常慢,估计打开主页需要3-4s的时间,我经过搜索发现很多人都有这 ...
- Hexo+Github: 博客网站搭建完全教程(看这篇就够了)
本篇教程首次发布在个人博客:sunhwee.com,想要获得最佳阅读体验,欢迎前往,建议用电脑查看教程文档. # 阅读须知 注意,这篇文章篇幅较长,主要针对新手,每一步很详细,所以可能会显得比较啰嗦, ...
- 码云上部署hexo博客框架
title: 码云上部署hexo博客框架 Hexo框架在码云上实现个人博客 本文受 https://www.jianshu.com/p/84ae2ba1c133 启发编写 本地调试 安装完Node.j ...
随机推荐
- shell生成指定长度的随机数
生成指定长度是随机数 # 8位纯数字的随机数 tr -cd '0-9' </dev/urandom | head -c 8 # 16位包含字母.数字的随机数 tr -cd '[:alnum:]' ...
- 一起学Android之Handler
概述 在Android开发中,有主线程(UI线程)和工作线程(Worker线程)之分,两个线程是相互独立的,并不能相互访问(主线程主要负责UI的更新,不能进行耗时的操作,工作线程主要负责耗时的操作,但 ...
- Customize the View Items Layout 自定义视图项目布局
In this lesson, you will learn how to customize the default editor layout in a Detail View. For this ...
- vue-cli引用vant使用rem自适应
摘要 由于需要用到弹出层但是懒得造轮子所以使用vant 介绍 使用的node包管理器为yarn vue-cli版本4 rem计算方式为index.html的js脚本计算 安装vant yarn add ...
- [转]Java虚拟机类加载机制
原文地址:http://blog.csdn.net/u013256816/article/details/50829596 看到这个题目,很多人会觉得我写我的java代码,至于类,JVM爱怎么加载就怎 ...
- linux下Oracle与swap分区大小配置规划
Oracle于Linux系统---交换空间大小规划 分三种常用情况(1)实际内存为1GB~2GB建议交换空间为内存的1.5倍 (2)实际内存为2GB~8GB建议交换空间与内存相同 (3)实际内存超过8 ...
- python while语句
一.while 1.while 死循环 f=True while f: print(1) print(2) 2.while 活循环 ①.正序 count = 1 while count <= 5 ...
- docker 无法启动
背景:想修改docker0的ip地址,所以在/etc/docker/daemon.json文件里加了[bip]. { "registry-mirrors": ["http ...
- PHP转Go系列:map映射
映射的定义 初识映射会很懵,因为在PHP中没有映射类型的定义.其实没那么复杂,任何复杂的类型在PHP中都可以用数组表示,映射也不例外. $array['name'] = '平也'; $array['s ...
- linux kernel下输入输出console如何实现【转】
转自:https://blog.csdn.net/skyflying2012/article/details/41078349 最近工作在调试usb虚拟串口,让其作为kernel启动的调试串口,以及u ...