我有一个运行fastcgi / PHP的Nginx服务器.我需要添加userdirs,但是我不能让PHP执行文件 – 它只是问我是否要下载它.它的工作没有userdir(例如它的工作在physibots.info/hugs.PHP,但不是physibots.info/~kisses/hugs.PHP).
配置:
server {
listen 80;
server_name physibots.info;
access_log /home/virtual/physibots.info/logs/access.log;
root /home/virtual/physibots.info/public_html;
location ~ ^/~(.+?)(/.*)?\.PHP${
fastcgi_param SCRIPT_FILENAME /home/$1/public_html$fastcgi_script_name;
fastcgi_pass unix:/tmp/PHP.socket;
}
location ~ ^/~(.+?)(/.*)?${
alias /home/$1/public_html$2;
autoindex on;
}
location ~ \.PHP${
try_files $uri /error.html/$uri?null;
fastcgi_pass unix:/tmp/PHP.socket;
}
}