Nginx 服务器如何安装安装SSL证书?请看本文介绍。
Nginx 是一款多功能、高性能、轻量级的服务器软件,是现代互联网基础设施中不可或缺的一部分,尤其适用于高并发、高流量的网站和应用。
以下属性中以 ssl 开头的属性代表与证书配置有关,其他属性请根据自己的需要进行配置。
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name test.wzjs100.com;
# root /usr/share/nginx/html;
#
ssl_certificate "/etc/nginx/conf.d/test.wzjs100.com.pem";
ssl_certificate_key "/etc/nginx/conf.d/test.wzjs100.com.key";
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_prefer_server_ciphers on;
location / {
proxy_pass http://127.0.0.1:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
4、保存 nginx.conf 文件后退出。
5、重启 Nginx 服务。
yum install nginx #安装
systemctl start nginx #启动
systemctl enable nginx #开机启动
vi /etc/nginx/nginx.conf #修改配置
systemctl reload nginx.service #保存后:重启:
systemctl status nginx.service #查看状态
知识阅读:
Nginx(发音为 "engine X")是一款高性能的开源 Web 服务器软件。但它不仅仅是一个 Web 服务器,它还是一个功能多样的网络工具,在现代互联网架构中扮演着非常重要的角色。
Nginx 的主要功能和用途:
推荐申请,价格随时改变!
{{item}}
{{item.title}}
{{items.productName}}
¥{{items.priceOne.price}}/年
{{item.title}}