From 5bf021e5650aa8281670aeb3d9e68dbfffee8869 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?L=C3=BCckemeyer?= <gero.lueckemeyer@hft-stuttgart.de>
Date: Mon, 29 Jan 2024 10:28:23 +0000
Subject: [PATCH] Update nginx.conf to cache only tasks and independent of host

---
 conf/nginx.conf | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/conf/nginx.conf b/conf/nginx.conf
index 8423dc1..0c31cff 100644
--- a/conf/nginx.conf
+++ b/conf/nginx.conf
@@ -6,11 +6,6 @@ events {
 }
 
 http {
-#    include conf/mime.types;
-#    include /etc/nginx/proxy.conf;
-#    include /etc/nginx/fastcgi.conf;
-#    index index.html index.htm index.php;
-
     default_type application/octet-stream;
     sendfile     on;
     tcp_nopush   on;
@@ -21,15 +16,19 @@ http {
     server {
         listen 8080;
 
-        location / {
+        location /v1/task {
             proxy_cache dta_cache;
             proxy_cache_background_update on;
             proxy_cache_lock on;
-            proxy_cache_key     "$scheme$host$request_uri";
+            proxy_cache_key     "$scheme$request_uri";
             proxy_cache_valid    200 302 1d;
             proxy_cache_methods GET HEAD POST;
 
-            proxy_pass http://backendcomposedtt:8080/;
+            proxy_pass http://backendcomposedtt:8080/v1/task;
+        }
+
+        location /v1/unittest {
+            proxy_pass http://backendcomposedtt:8080/v1/unittest;
         }
     }
 }
-- 
GitLab