From d874d015fdadb4710ce60ea6c0fdc5e22b4d65aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Gruszczy=C5=84ski?= Date: Sun, 12 Apr 2026 22:34:49 +0200 Subject: [PATCH] first commit --- .env.example | 2 +- README.md | 2 +- frontend/nginx/default.conf | 16 +++++++++++++--- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/.env.example b/.env.example index 6e10c2e..b36a780 100644 --- a/.env.example +++ b/.env.example @@ -3,7 +3,7 @@ ACCESS_TOKEN_EXPIRE_MINUTES=7899999 ALLOW_REGISTRATION=true DEFAULT_ADMIN_USERNAME=admin DEFAULT_ADMIN_PASSWORD=admin -APP_PORT=5580 +APP_PORT=5581 API_PREFIX=/api DATA_DIR=/app/storage DATABASE_URL=sqlite:////app/storage/routeros_backup_next.db \ No newline at end of file diff --git a/README.md b/README.md index 1f60fa0..0d81b78 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ cp .env.example .env ./start_prod.sh ``` Domyślnie frontend będzie dostępny na: -- `http://127.0.0.1:5580` +- `http://127.0.0.1:5581` ## Migracja starej bazy Flask/SQLite diff --git a/frontend/nginx/default.conf b/frontend/nginx/default.conf index dac8bf6..61c23ec 100644 --- a/frontend/nginx/default.conf +++ b/frontend/nginx/default.conf @@ -3,6 +3,11 @@ upstream backend_upstream { keepalive 16; } +map $uri $static_file { + ~*\.(?:css|js|mjs|png|jpg|jpeg|gif|svg|ico|webp|woff2?)$ 1; + default 0; +} + server { listen 80; server_name _; @@ -46,8 +51,7 @@ server { } location = /index.html { - expires -1; - add_header Cache-Control "no-store, no-cache, must-revalidate" always; + add_header Cache-Control "no-store, no-cache" always; try_files $uri =404; } @@ -73,6 +77,12 @@ server { } location / { - try_files $uri $uri/ /index.html; + proxy_pass http://web:80/; + + if ($static_file) { + add_header Cache-Control "public, max-age=31536000, immutable" always; + } + + add_header Cache-Control "no-store, no-cache" always; } }