环境:OneinStack安装LNMP(Linux+Nginx+Mysql+PHP)
由于SSL证书过期,需要重新配置,图文操作教程如下:
一、下载Gworg证书文件目录 ,都会有以下五个文件夹。新网虚拟主机只需要用到nginx文件夹。


解压开来有两个文件,尾缀为.key和.crt(pem)的文件。
2. 使用FTP链接阿里云服务器。把这两个证书文件上传到如下文件路径
/usr/local/nginx/conf/cert
3. 修改conf配置文件如下:文件路径如下
/usr/local/nginx/conf/nginx.conf
server {
listen 443 ssl;
server_name www.gworg.com;
root html;
index index.html index.htm;
ssl_certificate cert/1_www.gworg.com_bundle.crt; #将domain name.crt替换成您证书的文件名。
ssl_certificate_key cert/2_www.gworg.com.key; #将domain name.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 / {
root /data/wwwroot/default; #站点目录。
index index.html index.htm index.php;
}
location ~ [^/]\.php(/|$) {
#fastcgi_pass remote_php_ip:9000;
fastcgi_pass unix:/dev/shm/php-cgi.sock;
root /data/wwwroot/default;
fastcgi_index index.php;
include fastcgi.conf;
}
}4、重启服务器
常见问题
1、阿里云安全组443端口开放教程:https://www.gworg.com/Web-server/1354.html