From a38b929207e0543857867efa355c7c014e96a99e Mon Sep 17 00:00:00 2001
From: Etienne LOUPIAS <eloupias@grandlyon.com>
Date: Mon, 7 Feb 2022 15:51:35 +0100
Subject: [PATCH] feat(nginx): new conf for PWA handling

---
 nginx/dev.conf   |  3 +--
 ngsw-config.json | 10 ++++++++++
 2 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/nginx/dev.conf b/nginx/dev.conf
index d99a0f6f5..ea0c2185e 100644
--- a/nginx/dev.conf
+++ b/nginx/dev.conf
@@ -48,8 +48,7 @@ server {
   }
 
   location /api {
-    rewrite ^/api/(.*) /$1 break;
-    proxy_pass http://service-ram:3000/api;
+    proxy_pass http://service-ram:3000;
   }
 
   location /base-adresse/base-adresse-nationale/streets {
diff --git a/ngsw-config.json b/ngsw-config.json
index e5b82fb2a..100ac9f30 100644
--- a/ngsw-config.json
+++ b/ngsw-config.json
@@ -28,6 +28,16 @@
         "maxAge": "12h",
         "timeout": "5s"
       }
+    },
+    {
+      "name": "api",
+      "urls": ["/api/**"],
+      "cacheConfig": {
+        "strategy": "freshness",
+        "maxSize": 10000,
+        "maxAge": "12h",
+        "timeout": "5s"
+      }
     }
   ]
 }
-- 
GitLab