From 136d9e431b99aaafd40f4cdc60345f0d25479508 Mon Sep 17 00:00:00 2001 From: Antun Franjin Date: Wed, 3 Nov 2021 09:52:39 +0100 Subject: [PATCH 1/5] Trying to load static for efc admin --- dev/efc/deployment.yaml | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/dev/efc/deployment.yaml b/dev/efc/deployment.yaml index 39a78aa..90efc44 100644 --- a/dev/efc/deployment.yaml +++ b/dev/efc/deployment.yaml @@ -70,7 +70,7 @@ spec: persistentVolumeClaim: claimName: efc-pvc-dev - name: efc-dev-static - emptyDir: {} + --- # Persistent Volume Claim description apiVersion: v1 @@ -172,22 +172,7 @@ data: proxy_read_timeout 300s; proxy_send_timeout 300s; send_timeout 300s; - } - - location /static { - proxy_pass http://backend/static; - proxy_redirect off; - - proxy_set_header Host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - - proxy_read_timeout 300s; - proxy_send_timeout 300s; - send_timeout 300s; - } - - + } error_page 404 =200 /index.html; From a1554b6efc2673c14fd0252578cf24f5a8484954 Mon Sep 17 00:00:00 2001 From: Antun Franjin Date: Wed, 3 Nov 2021 10:07:28 +0100 Subject: [PATCH 2/5] Remove line --- dev/efc/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/efc/deployment.yaml b/dev/efc/deployment.yaml index 90efc44..7410411 100644 --- a/dev/efc/deployment.yaml +++ b/dev/efc/deployment.yaml @@ -172,7 +172,7 @@ data: proxy_read_timeout 300s; proxy_send_timeout 300s; send_timeout 300s; - } + } error_page 404 =200 /index.html; From 07bfbcc2d1746a3fdce080088fa07bf9a91893a2 Mon Sep 17 00:00:00 2001 From: Antun Franjin Date: Fri, 5 Nov 2021 12:00:28 +0100 Subject: [PATCH 3/5] Fixed after reload 404 becaouse of route of administration. --- dev/efc/deployment.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dev/efc/deployment.yaml b/dev/efc/deployment.yaml index 7410411..b1c6e0c 100644 --- a/dev/efc/deployment.yaml +++ b/dev/efc/deployment.yaml @@ -135,6 +135,12 @@ data: try_files $uri $uri /index.html =404; } + location /administration { + root /srv/efc; + index index.html index.htm; + try_files $uri $uri /index.html =404; + } + location ~ ^/api { proxy_pass http://backend; proxy_redirect off; From 15bed649ed3480931a981af580d9dc81c9277000 Mon Sep 17 00:00:00 2001 From: Antun Franjin Date: Fri, 5 Nov 2021 13:45:33 +0100 Subject: [PATCH 4/5] add static-backend. --- dev/efc/deployment.yaml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/dev/efc/deployment.yaml b/dev/efc/deployment.yaml index b1c6e0c..3fa8554 100644 --- a/dev/efc/deployment.yaml +++ b/dev/efc/deployment.yaml @@ -57,9 +57,6 @@ spec: volumeMounts: - mountPath: /opt/efc/storage name: efc-pv-dev - - mountPath: /opt/efc/static - name: efc-dev-static - envFrom: - configMapRef: name: efc-dev-config-dev volumes: @@ -69,7 +66,6 @@ spec: - name: efc-pv-dev persistentVolumeClaim: claimName: efc-pvc-dev - - name: efc-dev-static --- # Persistent Volume Claim description @@ -178,7 +174,20 @@ data: proxy_read_timeout 300s; proxy_send_timeout 300s; send_timeout 300s; - } + } + + location /static-backend { + proxy_pass http://backend; + proxy_redirect off; + + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + + proxy_read_timeout 300s; + proxy_send_timeout 300s; + send_timeout 300s; + } error_page 404 =200 /index.html; From 582ad949e351f5f97698fc8cb8ced366367dcf73 Mon Sep 17 00:00:00 2001 From: Antun Franjin Date: Fri, 5 Nov 2021 18:32:10 +0100 Subject: [PATCH 5/5] fix volume typo --- dev/efc/deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/dev/efc/deployment.yaml b/dev/efc/deployment.yaml index 3fa8554..2c74d88 100644 --- a/dev/efc/deployment.yaml +++ b/dev/efc/deployment.yaml @@ -57,6 +57,7 @@ spec: volumeMounts: - mountPath: /opt/efc/storage name: efc-pv-dev + envFrom: - configMapRef: name: efc-dev-config-dev volumes: