rewrite ^/(?:(.*)/|)index\.(?:php|htm) /$1 permanent;
rewrite ^/(.*)\.(php|htm) /$1 permanent;
rewrite ^/(.*)/$ /$1 permanent;
rewrite ^/page/([^/]*)$ /page.php?param=$1;
rewrite ^/$ /index.php;
location ~ \.php$ {
include fastcgi.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
location / {
try_files $uri @extensionless-php;
}
location @extensionless-php {
try_files $uri.php $uri/index.php =404;
include fastcgi.conf;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
}
error_page 404 /error;