参考资料

  1. nginx反向代理配置详解
  2. Nginx作为反向代理的功能
  3. nginx 配置ssl
  4. nginx启动命令和停止命令
  5. Nginxlimit_conn:并发连接数限制模块详细说明以及案例
  6. nginx 查看配置文件
  7. 查看nginx 设置配置文件路径方法
  8. Nginx upstream容错机制详解详细说明以及案例
  1. 获取SSL证书和私钥文件(通常为 .crt.key 文件)。

  2. 打开Nginx配置文件(通常位于 /etc/nginx/nginx.conf/etc/nginx/sites-available/default)。

  3. server 块中添加以下配置:

server {
    listen 443 ssl;
    server_name yourdomain.com;

    ssl_certificate /path/to/your/certificate.crt;
    ssl_certificate_key /path/to/your/private.key;

    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers HIGH:!aNULL:!MD5;

    location / {
        root /var/www/html;
        index index.html index.htm;
    }
}
  1. 保存并关闭配置文件。

  2. 测试Nginx配置是否正确:nginx -t

  3. 重新加载Nginx配置:systemctl reload nginxservice nginx reload

确保将 yourdomain.com/path/to/your/certificate.crt/path/to/your/private.key 替换为实际的值。

声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。