0
我试过了所有的东西,并且已经验证了所有的东西都在同一个组上运行。aws + centos 7 +内置nginx ngx_pagespeed + php-fpm =找不到文件
而且chown'd文件nginx的:nginx的和他们chmod'd 755 这里是服务器块
server {
listen 80;
root /var/www/example.com/public_html;
index index.php index.html index.htm;
server_name example.com;
location/{
try_files $uri $uri/ /index.php?q=$uri&$args;
}
# Pagespeed main settings
pagespeed on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# Ensure requests for pagespeed optimized resources go to the pagespeed
# handler and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon" { }
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_intercept_errors on;
fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
}
}
什么是您试图访问的资源?只是http://example.com?如果是这样,你确定'/ var/www/example.com/public_html'中存在'index.php'吗? –
我必须分开我试图访问的文件,info.php和test.php。 有一个index.html可以正确返回。 FYI php从终端运行。 – etrey
来自nginx错误日志的响应:23820#0:* 11在读取来自上游的响应头时,stderr中发送的FastCGI:“主要脚本未知” – etrey