Recently I have reinstalled a server with Ubuntu 14.04 LTS, nginx/1.6.1 and php5-fpm. When I try to access index.html it's working when I try to access index.php i get "404 Not Found". I double checked the .conf files and I can't find what is the problem.
server {
listen m.y.i.p:80;
server_name www.example.com;
rewrite ^(.*) http:// example.com$1 permanent;
}
server {
listen m.y.i.p:80;
server_name example.com;
root /var/www;
index index.php index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
access_log off;
error_log /var/www/error.log;
rewrite_log on;
error_page 403 404 /404.html;
error_page 500 502 503 504 /404.html;
location = /404.html {
root /var/www;
}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
expires 365d;
}
}
Please help. Thank you!