I just installed Nginx with PHP 7.1-fpm on Ubuntu 16.04 and I have a problem. When I wan to visit for example http://example.dev it downloads index.php instead of showing homepage, but for example http://example.dev/registration works well.
This is my nginx config:
server {
listen 80;
listen [::]:80;
root /var/www/example/www;
index index.php index.html;
server_name example.dev;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
Thanks for your answers.