[Nginx] Avoid php extensions, use rewrite

master
André 2018-10-04 14:34:00 +02:00
parent b2067cb521
commit 2f18eb5ad0
1 changed files with 12 additions and 0 deletions

View File

@ -50,6 +50,18 @@ server {
absolute_redirect off;
root /web;
location / {
try_files $uri $uri/ @strip-ext;
}
location /edit {
rewrite ^/edit/(.*)/(.*) /edit.php?$1=$2;
}
location @strip-ext {
rewrite ^(.*)$ $1.php last;
}
location ~ ^/api/v1/(.*)$ {
try_files $uri $uri/ /json_api.php?query=$1;
}