From 8823d0be817dc09f8e1f6ddcd16ac2338d3f715c Mon Sep 17 00:00:00 2001 From: Jakub Czajka Date: Sun, 12 May 2024 00:52:15 +0200 Subject: [PATCH] Serve /views based on the URI. --- views.sh | 4 +--- website.conf | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/views.sh b/views.sh index 915493e..dbb2015 100755 --- a/views.sh +++ b/views.sh @@ -4,8 +4,6 @@ . /etc/environment -_querypath="/${FILENAME}" - echo "HTTP/1.1 200 OK" echo "Content-Type: text/html" echo "" @@ -14,4 +12,4 @@ echo "" --no-align --command="\ SELECT COUNT(*) FROM access_logs -WHERE access_log::json->>'path' = '${_querypath}'" +WHERE access_log::json->>'path' = '/${URL}'" diff --git a/website.conf b/website.conf index 393297d..5f471fa 100644 --- a/website.conf +++ b/website.conf @@ -34,7 +34,7 @@ server { include fastcgi_params; fastcgi_pass unix:/var/run/fcgiwrap.socket; - fastcgi_param URL ${dollar}uri; + fastcgi_param URL ${dollar}1; fastcgi_param SCRIPT_FILENAME ${dollar}document_root/views.sh; } -- 2.39.5