Skip to content

Commit

Permalink
NGINX setup to serve assets
Browse files Browse the repository at this point in the history
  • Loading branch information
oscgonfer committed Oct 20, 2024
1 parent eaa2adb commit 37b2251
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions compose/web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
7 changes: 7 additions & 0 deletions scripts/nginx-conf/api.smartcitizen.me.conf
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 37b2251

Please sign in to comment.