Extensionless php for API

This commit is contained in:
Victor Westerlund 2021-02-05 15:39:33 +01:00
parent 4516299557
commit 38bf06635e

View file

@ -61,8 +61,9 @@ server {
index router.php;
location \ {
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
location / {
try_files $uri $uri.html $uri/ @extensionless-php;
index index.html index.htm index.php;
}
location ~ \.php$ {
@ -72,6 +73,10 @@ server {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
location @extensionless-php {
rewrite ^(.*)$ $1.php last;
}
location ~ /\.git {
deny all;
return 404;