编辑/etc/nginx/sites-enabled/default和
/etc/nginx/sites-enabled/default
更改下列位置代码
server {
listen 443;
server_name xxx.xxx.xxx;#填写域名
root /var/www/html;#网页根目录
index index.html index.htm index.php;#首页文件
ssl on;
ssl_certificate /etc/nginx/xxx.xxx.xxx.crt;#域名crt文件
ssl_certificate_key /etc/nginx/xxx.xxx.xxx.key;#域名key文件
ssl_session_timeout 5m;
ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
ssl_prefer_server_ciphers on;
location / {
try_files $uri $uri/ =404;
}
location ~ \.php$ { #设置php
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
}
保存并重启
/etc/init.d/nginx restart