操作环境:

  • 硬件:华为云服务器
  • 操作系统:Rocky Linux 9.0 64bit
  • 服务器软件:nginx 1.24.0,php 8.2.6,openssl 3.0.7

问题描述

  • 启用SSL前,用浏览器访问站点正常,启用ssl后,用浏览器访问站点( index.php),提示找不到文件。
  • 用指令 systemctl status php-fpm查看php-fpm服务状态,显示正常。
  • 用指令 netstat -tunlp | grep 9000查看php-fpm服务监听端口,显示正常。
  • 用指令 systemctl status nginx.service查看nginx服务状态,显示正常。

解决方案

  1. 修改/usr/local/nginx/conf/nginx.conf配置文件。将以下关于php的设置内容,从http server复制到https server中。
  1. 运行指令 sudo systemctl restart nginx.service,重启nginx服务。
  2. 再次访问站点,一切OK。