在Centos安装ssl并运行的方法:通过安装Nginx来配置运行ssl,步骤如下:安装nginx,命令如:sudo yum install epel-releasesudo yum install nginx再输入命令让nginx随系统启
在Centos安装ssl并运行的方法:
通过安装Nginx来配置运行ssl,步骤如下:
安装nginx,命令如:
sudo yum install epel-release
sudo yum install nginx
再输入命令让nginx随系统启动而启动,命令如:
sudo systemctl enable nginx
打开nginx配置文件,在Http节点下配置两个server节点,其他不变,例如:
server
{
listen 443;
server_name your-domain.com www.your-domain.com;
ssl on;
ssl_certificate /root/ssl/your-domain.crt;
ssl_certificate_key /root/ssl/your-domain.key;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
location / {
proxy_buffer_size 128k;
proxy_buffers 32 32k;
proxy_busy_buffers_size 128k;
proxy_pass http://127.0.0.1:912;
}
}
server
{
listen 80;
server_name your-domain.com www.your-domain.com;
rewrite ^(.*)$ https://$host$1 permanent;
}
--结束END--
本文标题: 如何在centos安装ssl并运行
本文链接: https://lsjlt.com/news/114459.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
2024-05-24
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0