mirror of
https://codeberg.org/vlw/victorwesterlund.com.git
synced 2025-09-14 03:23:41 +02:00
Extensionless php for API
This commit is contained in:
parent
4516299557
commit
38bf06635e
1 changed files with 7 additions and 2 deletions
|
@ -61,8 +61,9 @@ server {
|
||||||
|
|
||||||
index router.php;
|
index router.php;
|
||||||
|
|
||||||
location \ {
|
location / {
|
||||||
try_files $uri $uri/ $uri.html $uri.php$is_args$query_string;
|
try_files $uri $uri.html $uri/ @extensionless-php;
|
||||||
|
index index.html index.htm index.php;
|
||||||
}
|
}
|
||||||
|
|
||||||
location ~ \.php$ {
|
location ~ \.php$ {
|
||||||
|
@ -72,6 +73,10 @@ server {
|
||||||
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
|
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
location @extensionless-php {
|
||||||
|
rewrite ^(.*)$ $1.php last;
|
||||||
|
}
|
||||||
|
|
||||||
location ~ /\.git {
|
location ~ /\.git {
|
||||||
deny all;
|
deny all;
|
||||||
return 404;
|
return 404;
|
||||||
|
|
Loading…
Add table
Reference in a new issue