127.0.0.1 - - [17/Apr/2015:19:15:36 +0200] "GET / HTTP/1.1" 200 31 "-" "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:34.0) Gecko/20100101 Firefox/34.0"
没有一点输出。 如果我从控制台php5 index.php运行那里有一个html输出。
nginx的配置是(/etc/nginx/sites-enabled/nominatim.mytest.com ):
server {
root /var/www/nominatim.mytest.com;
index index.html index.htm index.php;
server_name nominatim.mytest.com;
location ~ [^/]\.php(/|$){
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
主机文件:
127.0.0.1 nominatim.mytest.com
机器是:
Ubuntu 14.10
postgis 2.1.3+dfsg-4ubuntu0.1
postgresql-9.4
php5 5.5.12+dfsg-2ubuntu4.3
答案 0 :(得分:2)
增加:
fastcgi_param SCRIPT_FILENAME document_root$fastcgi_script_name;
内部配置文件解决了问题。
配置文件的一部分:
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME document_root$fastcgi_script_name;
}