index.php不适用于TOR nginx

index.php不适用于TOR nginx,php,nginx,debian,tor,Php,Nginx,Debian,Tor,全部。 我将debian与nginx和php5 fpm一起使用。我的网站功能齐全,然后安装了Tor来创建洋葱网站。我成功地将其配置为加载index.html,但是,当我使用index.php时,Tor浏览器不会显示页面。相反,Tor浏览器下载index.php。我不确定我需要做什么配置。我这样做的目的是为了学习。我不关心安全性,也不关心是否真正使用.洋葱网站。虽然我还没弄明白,但这让我很烦恼。多谢各位 这是我在/etc/nginx/sites中的服务器块配置/ server { listen 1

全部。 我将debian与nginx和php5 fpm一起使用。我的网站功能齐全,然后安装了Tor来创建洋葱网站。我成功地将其配置为加载index.html,但是,当我使用index.php时,Tor浏览器不会显示页面。相反,Tor浏览器下载index.php。我不确定我需要做什么配置。我这样做的目的是为了学习。我不关心安全性,也不关心是否真正使用.洋葱网站。虽然我还没弄明白,但这让我很烦恼。多谢各位

这是我在/etc/nginx/sites中的服务器块配置/

server {
listen 127.0.0.1:80;

root /var/www/html/;
index index.php index.html index.htm;
server_name 4bgxjb2vkb7tvsgw.onion;

location / {
 try_files $uri $uri/ =404;
 }

location ~ \.php$ {
 root /var/www/html/;
 include snippets/fastcgi-php.conf;
 fastcgi_pass unix:/var/run/php5-fpm.sock;
 fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
      include        fastcgi_params;
 }

location ~ /\.ht {
 deny all;
 }
}
snippets/fastcgi-php.conf:

# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+\.php)(/.+)$;

# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;

# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;

fastcgi_index index.php;
include fastcgi.conf;

谢谢你的帮助

试试这样的方法:

 location / {
    try_files $uri $uri/ =404;
}
error_page 401 403 404 /404.html;
location = /404.html {
root /usr/share/nginx/html;
} 

error_page 500 502 503 504 /50x.html;
location = /50x.html {
    root /usr/share/nginx/html;
}

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_split_path_info ^(.+\.php)(/.+)$;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    include fastcgi_params;
}

curl-v localhost在服务器上为您提供了什么?连接:keep alive