Configure HTTPS encrypted server on Nginx
Foreword Recently, when developing a WeChat Mini Program, I needed to use HTTPS, so I went through some trouble to set it up. Super Simple Steps 1. Apply for an SSL Certificate Cloud server providers typically offer this service. I applied for one on Tencent Cloud, and it was completed in ten minutes. 2. Upload the Certificate Upload it to a folder. 3. Configure Nginx Online resources suggest directly modifying the /etc/nginx/nginx.conf file. However, on my server, this file did not contain a "server" block for configuration. Therefore, it is necessary to modify the /et
目录7 个章节
Preface
Recently, developing a WeChat mini-program required using Https, so I fiddled around with it.
Super Simple Steps
1. Applying for an SSL Certificate
Most cloud server providers offer this service. I applied for one on Tencent Cloud, and it was completed in ten minutes.
2. Upload Certificate
Upload to a folder.
3. Configure Nginx
Online resources typically suggest directly modifying the /etc/nginx/nginx.conf file.
However, on my server, this file does not contain a server block for configuration.
Therefore, you need to modify the virtual host configuration file located in /etc/nginx/sites-available.
Basic Configuration: Simply add this section to your existing virtual host configuration:
server {
#SSL parameters
listen 443 ssl;
server_name example.com;
#Certificate file
ssl_certificate /path/to/example.com.crt;
#Private key file
ssl_certificate_key /path/to/example.com.key;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers HIGH:!aNULL:!MD5;
#...
}
References
https://aotu.io/notes/2016/08/16/nginx-https/index.html https://blog.csdn.net/duyusean/article/details/79348613

About

For more interesting operations, please follow my WeChat public account: DealiAxy
Every article is included in my blog: blog.deali.cn
_EOF_
Configure HTTPS encrypted server on Nginx
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
Ubuntu-16-04-升级Python版本到3-6
前言 没办法,unity桌面实在是太好用了,Ubuntu18.04上安装了unity桌面毕竟不够完美,所以我昨天就降级到Ubuntu16.04,享受一波原生Unity桌面的快感。 一切都OK,不过Python版本有点低,所以要用万能PPA源升级一下。 操作 安装Python3.6 sudo add-apt-repository ppa:jonathonf/python-3.6 sudo apt-g
2025-10-27 · 系统配置 · 约 1 分钟
配置MariaDB数据库服务端远程访问
操作步骤 开启远程访问权限 连接MariaDB数据库,执行以下命令开启远程访问。 grant all privileges on *.* to 'root'@'192.168.248.248' identified by 'password'; flush privileges; 如果需要任意IP地址访问,就把IP地址换成%。 修改配置文件 在网络上能搜索到的资料都只说了第一点,然而亲测之后并没有
2025-10-27 · 系统配置 · 约 1 分钟
在Manjaro上配置国内源
前言 之前我一直用官方源的,但是最近发现官方源变慢了,于是想要切换国内源,顺手做个笔记。 操作 使用以下命令,生成可用中国镜像站列表: sudo pacman-mirrors -i -c China -m rank 刷新完列表之后会弹出来一个框让你选择软件源,这里的就都是国内源了,选择一个喜欢的就行(当然要选择两个以上也没问题。) 日常桌面截图
2025-10-27 · 系统配置 · 约 1 分钟
别再手动复制SSH公钥了,Linux服务器一键从GitHub快速导入公钥
输入GitHub用户名就自动导入SSH公钥?Ubuntu这懒人功能挺省事。原理不就是爬取`https://github.com/用户名.keys`吗?手动用`curl`也能实现,装`ssh-import-id`更高效,但谁稀罕这些花里胡哨的。
2026-03-11 · 系统配置 · 约 1 分钟
讨论
共 0 条加载评论中…