I'm having difficulty passing the root of a test subdomain to index.php on a new install.
fastcgi_index is pointed at index.php. If I load domain.tld/index.php directly (or any other URL), all is well. If I go to domain.tld/ nginx serves a download rather than executing index.php.
I think it's perhaps easiest to post the whole configuration. Normally, this works for me, so I'm unsure of what the variable may be? (I had been using WordPress, though, and this is the first time I've done rules for Vanilla, so perhaps I'm muddled and did something wrong with my new nginx rules that I'm not spotting!)
Thanks!
server {
listen 80;
server_name createdigitalnoise.com;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
root /home/cdnoise/vanilla;
index index.php index.html;
location / {
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
rewrite ^(.+)$ /index.php$1 last;
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
}
location ~ \.php($|/) {
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
set $script $uri;
set $path_info "";
if ($uri ~ "^(.+\.php)(/.+)") {
set $script $1;
set $path_info $2;
}
fastcgi_param SCRIPT_FILENAME $document_root$script;
fastcgi_param SCRIPT_NAME $script;
fastcgi_param PATH_INFO $path_info;
}
}
}