nginx和php都装好了,怎么还是无法访问项目目录
http{includemime.types;default_typeapplication/octet-stream;client_max_body_size50m;#...
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 50m;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name ip地址 localhost;
charset utf-8;
index index.php index.html index.htm;
root /data/webdata/www;
location ~/fyysz{
root html/wap;
index index.html index.htm;
}
location /operation{
index index.php;
if (-e $request_filename) {
break;
}
if (!-e $request_filename) {
#rewrite ^/(.*)$ /index.php/$1 last;
#rewrite ^(.*)$ /index.php/$1 last;
#rewrite ^/(operation|service)$ /index.php/$1 last;
rewrite "/operation" /operation/index.php/$1 last;
break;
}
}
location ~ \.php{
#root /data/webdata/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$"){
set $real_script_name $1;
set $path_info $2;
}
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}
} 展开
include mime.types;
default_type application/octet-stream;
client_max_body_size 50m;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 80;
server_name ip地址 localhost;
charset utf-8;
index index.php index.html index.htm;
root /data/webdata/www;
location ~/fyysz{
root html/wap;
index index.html index.htm;
}
location /operation{
index index.php;
if (-e $request_filename) {
break;
}
if (!-e $request_filename) {
#rewrite ^/(.*)$ /index.php/$1 last;
#rewrite ^(.*)$ /index.php/$1 last;
#rewrite ^/(operation|service)$ /index.php/$1 last;
rewrite "/operation" /operation/index.php/$1 last;
break;
}
}
location ~ \.php{
#root /data/webdata/www;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
set $path_info "";
set $real_script_name $fastcgi_script_name;
if ($fastcgi_script_name ~ "^(.+?\.php)(/.+)$"){
set $real_script_name $1;
set $path_info $2;
}
include fastcgi.conf;
fastcgi_param SCRIPT_FILENAME $document_root$real_script_name;
fastcgi_param SCRIPT_NAME $real_script_name;
fastcgi_param PATH_INFO $path_info;
}
}
} 展开
1个回答
2019-05-12
展开全部
先访问下ngnix下面得静态文件,看可以访问不,看会不会报错,如果没问题的话,就说nginx配置没问题。
然后测试php文件,访问php程序,看下页面的返回状态码,如果是服务器错误500的话,就说明php配置的有问题,看下nginx的错误日志,是路径没错误啊,还是别的程序,错误日志里面都有会有反馈的,检查下php-fpm启动了么,或者看下程序是不是错了!
可以贴下错误日志帮你分析下
然后测试php文件,访问php程序,看下页面的返回状态码,如果是服务器错误500的话,就说明php配置的有问题,看下nginx的错误日志,是路径没错误啊,还是别的程序,错误日志里面都有会有反馈的,检查下php-fpm启动了么,或者看下程序是不是错了!
可以贴下错误日志帮你分析下
镭速传输
2024-10-28 广告
2024-10-28 广告
作为深圳市云语科技有限公司的一员,我们推出的FTP替代升级方案,旨在解决传统FTP在安全性、效率、稳定性及管理方面的不足。我们的产品通过采用自主研发的Raysync传输协议,实现高效、安全的文件传输,即使在恶劣网络环境下也能确保传输的稳定性...
点击进入详情页
本回答由镭速传输提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询