Added dummy file to "api/" and made it canonial in server.conf

Added "router.php" which will function as a proxy for all api requests
This commit is contained in:
Victor Westerlund 2020-11-30 07:21:38 +01:00
parent 26ec726238
commit 9fda2e2e36
2 changed files with 7 additions and 5 deletions

5
api/router.php Normal file
View file

@ -0,0 +1,5 @@
<?php
http_response_code("503 Service Unavailable");
header("Content-Type: text/plain");
echo "Not available yet";

View file

@ -59,11 +59,8 @@ server {
root /var/www/github_victorwesterlund_victorwesterlund.com/api;
location \ {
try_files $uri $uri.html $uri/ =404;
}
location ~ \.php$ {
location \* {
try_files /router.php$request_uri =404;
add_header Access-Control-Allow-Origin *;
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;