]> git.ekhem.eu.org Git - website.git/commitdiff
Serve /views based on the URI.
authorJakub Czajka <jczajka@google.com>
Sat, 11 May 2024 22:52:15 +0000 (00:52 +0200)
committerJakub Czajka <jczajka@google.com>
Sat, 11 May 2024 23:03:41 +0000 (01:03 +0200)
views.sh
website.conf

index 915493e6136abd49d3d90e4877bf61913470e6b9..dbb201525365e995011431d1fcddd354e60eccbf 100755 (executable)
--- 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}'"
index 393297db73735bf3152aab0c4738f4f81ffd8b00..5f471fa78d0b120c9d9123fb9f30d4ff8b66acec 100644 (file)
@@ -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;
     }