From 45162995579fe5fda0d05c62c03ffe1823f297d3 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Fri, 5 Feb 2021 15:27:43 +0100 Subject: [PATCH] Added optional veto router.php index Attempting an extensionless API URL. --- server.conf | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/server.conf b/server.conf index d88a643..f4f7cbf 100644 --- a/server.conf +++ b/server.conf @@ -59,10 +59,16 @@ server { root /var/www/victorwesterlund.com/api/endpoint; - location \* { - try_files $uri.php $uri/ =404; + index router.php; + + location \ { + try_files $uri $uri/ $uri.html $uri.php$is_args$query_string; + } + + location ~ \.php$ { + try_files $uri =404; add_header Access-Control-Allow-Origin *; - include snippets/fastcgi-php-router.conf; + include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.3-fpm.sock; }