我有一个设置了
PHP-FPM的Nginx HTTP服务器,几乎一切正常.我希望能够转到path / to / file并且它给了我index.php?url = path / to / file,它确实如此.但是,它下载实际的PHP,它不会在浏览器中执行它.我不确定是什么原因造成的.
Nginx配置:
server {
listen 80;
server_name sandbox.domain.tld;
access_log /path/to/domain/log/sandbox.access.log;
error_log /path/to/domain/log/sandbox.error.log;
location / {
root /path/to/sandbox;
index index.php;
if (!-e $request_filename) {
rewrite ^/beta/(.+)$/beta/index.php?url=$1 break;
}
}
location ~ \.php${
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include /usr/local/nginx/conf/fastcgi_params;
fastcgi_param SCRIPT_FILENAME /path/to/sandbox$fastcgi_script_name;
}