返回文章列表文章索引阅读全文
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 许可协议。转载请注明出处!

相关文章

讨论

共 0 条

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

加载评论中…