第一步:去云服务器平台下载ssl证书,下载下来解压后里面会有俩文件
第二步将这个文件放在一个文件夹里面比如叫cert.将改文件上传到服务器/usr/local/nginx/conf目录里
第三步:打开要加https的域名配置文件,将原来里面的整个server里面内容复制一份,放在原来那个server下边,如下.
server
{
listen 80;
#listen [::]:80 default_server ipv6only=on;
server_name bus.tjgbank.cn;
index index.html index.htm index.php book.php;
root /home/wwwroot/default/bus/public;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=$1 last;
break;
}
}
# location /
#{