...
index index.php index.html index.htm;
location ~ \.php$ {
...
fastcgi_index index.php;
}
try_files $uri $uri/ =404;
ip route add blackhole 127.0.0.1/32
server {
listen 80;
server_name example.com;
return 301 https://$server_name$request_uri; # enforce https
# rewrite ^(.*) https://www.example.com$uri permanent;
}