Nginx with php-fastcgi - connection to
this guide
2 Replies
installedconfigured
@alexfornuto:
It sounds to me like PHP isn't being executed on the server. Start by confirming that you
the PHP handler, and installedNginx to utilize it. configured
Yes, those both are done, I double checked it right now.
After reading a bit more, I added following code
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /var/www/test.example.com/public_html$fastcgi_script_name;
}
to my /etc/nginx/conf.d/test.example.com.conf and now I get error 404 when I attempt to load any page.
Edit: Resolved with following /etc/nginx/conf.d/test.example.com.conf
server {
listen 80;
listen 443 default ssl;
server_name test.example.com;
root /var/www/test.example.com/public_html;
access_log /var/www/test.example.com/logs/access.log;
error_log /var/www/test.example.com/logs/error.log;
location / {
try_files $uri $uri/ /index.php;
}
location ~ \.php$ {
try_files $uri =404;
include /etc/nginx/fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
}