From 87c5ed157c5af85d61d016b6307ef3755ebb031b Mon Sep 17 00:00:00 2001 From: Oscar Gonzalez Date: Sun, 20 Oct 2024 15:49:48 +0000 Subject: [PATCH] NGINX setup to serve assets --- compose/web.yml | 1 + scripts/nginx-conf/api.smartcitizen.me.conf | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/compose/web.yml b/compose/web.yml index 550f1960..a3857300 100644 --- a/compose/web.yml +++ b/compose/web.yml @@ -11,6 +11,7 @@ services: - 443:443 - 443:443/udp volumes: + - ../public:/app/public - ../scripts/nginx-conf/api.smartcitizen.me.conf:/etc/nginx/conf.d/api.smartcitizen.me.conf - ../scripts/nginx.conf:/etc/nginx/nginx.conf - ../scripts/certs:/etc/ssl:ro diff --git a/scripts/nginx-conf/api.smartcitizen.me.conf b/scripts/nginx-conf/api.smartcitizen.me.conf index 88962260..355627d8 100644 --- a/scripts/nginx-conf/api.smartcitizen.me.conf +++ b/scripts/nginx-conf/api.smartcitizen.me.conf @@ -59,6 +59,13 @@ server { listen [::]:443 ssl; ssl_certificate /etc/ssl/star_smartcitizen_me.pem; ssl_certificate_key /etc/ssl/star_smartcitizen_me.key; + root /app/public; + + location ~* ^/assets { + expires max; + add_header Cache-Control public; + break; + } try_files $uri/index.html $uri @app;