In nginx , the first file it will search for to open is the nginx index file.
In that case , in order to show your own index.php file, some configuration have to be made:
- log in to root
- vim /etc/nginx/sites-enabled/default
- #Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html; - location ~ \.php$ {
include snippets/fastcgi-php.conf;
#
# # With php5-cgi alone:
# fastcgi_pass 127.0.0.1:9000;
# # With php5-fpm:
fastcgi_pass unix:/var/run/php5-fpm.sock;
} - Remember to un command as step 4 because nginx itself cannot process php c
To trace the error log file :
tail -f /var/log/nginx/error.log