【发布时间】:2023-04-05 00:54:01
【问题描述】:
nginx的配置如下:
server {
listen 80;
server_name www.example.com;
root /home/wwwroot/example.com;
index index.php index.html index.htm;
location / {
index index.php index.html index.htm;
}
location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
if (!-e $request_filename) {
rewrite ^/(.*)$ /index.php/$1 last;
break;
}
location ~ /\.ht {
deny all;
}
}
请给我一些建议,谢谢~
【问题讨论】:
-
您从哪里获得应用程序根目录上的
502 bad gateway? -
是的,在应用程序根目录
-
@RahilWazir 在应用程序根目录
-
@RahilWazir Centos5.7 X86_64
-
对于初学者,请确保 php 服务正在运行
ps -ef | grep php和sudo netstat -ntlp | grep 9000
标签: codeigniter nginx