曦远 (DealiAxy)一份私人的文字刊物

StarBlog
返回文章列表折页手记阅读全文
系统配置

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

曦远 (DealiAxy)约 4 分钟
目录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-18-04-修改登录界面背景图

前言 Ubuntu 18.04用了一段时间了,在Gnome桌面的加持下,兔子 18.04 的颜值还不错,加上自己搭配了几套GTK主题,简直美滋滋,唯一美中不足的就是,Ubuntu的登录管理器换成GDM之后,登录界面背景没办法修改了,这怎么行呢,于是经过一番折腾,有了本文。 首先,准备一张图片 图片的尺寸呢,根据你的屏幕分辨率确定咯。 然后把图片放到/usr/share/backgrounds/目录

2025-10-27 · 系统配置 · 约 1 分钟

内存不够用?在Linux上使用swapfile配置交换空间

前言 几个月前我还兴高采烈写了篇文章说给笔记本升级了内存配置,从乞丐版的4G一跃成为16G高富帅,然而,这几个月来我备受电脑死机的折磨,我现在有理由怀疑我可能买了假的内存条,于是没有办法,只能换回原厂的4G内存条,~~(然后准备赚部台式机)~~,问题不大。 换上4G内存条之后效果显著,只开了一个谷歌浏览器,内存占用就已经到了80%了,JB家的IDE是决计不敢再用了,可是这样还是难以满足系统对内存空

2025-10-27 · 系统配置 · 约 1 分钟

讨论

共 0 条

良言一句三冬暖,恶语伤人六月寒。

加载评论中…