What will server search for the first things & Error log (nginx)

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:

  1. log in to root
  2. vim /etc/nginx/sites-enabled/default
  3. #Add index.php to the list if you are using PHP
    index index.html index.htm index.nginx-debian.html;
  4. location ~ \.php$ {
    include snippets/fastcgi-php.conf;
    # # With php5-cgi alone:
    # fastcgi_pass;
    # # With php5-fpm:
    fastcgi_pass unix:/var/run/php5-fpm.sock;
  5. 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

You may also like...