1.进入nginx安装路径,我的是/usr/local/nginx
vi conf/nginx.conf

location ~ \.php$ {
root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
include fastcgi_params;
}

前面的#去掉

location / {
root html;
index index.php index.html index.htm;
}

index.html 前添加index.php
如果说访问nginx还是不能访问,请查看防火墙是否关闭,请关闭防火墙
将上面的fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
改为fastcgi_param SCRIPT_FILENAME /usr/local/nginx/html$fastcgi_script_name;
(其中/usr/local/nginx   是你nginx安装的目录)



相关文章:

  • 2021-06-16
  • 2022-12-23
  • 2021-10-12
  • 2021-10-09
  • 2021-06-21
  • 2022-02-21
  • 2022-12-23
  • 2021-11-09
猜你喜欢
  • 2022-12-23
  • 2021-08-01
  • 2021-06-14
  • 2021-12-08
  • 2022-12-23
  • 2022-12-23
  • 2021-10-29
相关资源
相似解决方案