From 674ba6d25482db71806a84b8ebb45b5fa1ff31f7 Mon Sep 17 00:00:00 2001 From: MoonTestUse1 Date: Wed, 25 Dec 2024 20:33:47 +0600 Subject: [PATCH] 20:33 --- backend/run.py | 9 +++++---- backend/sql_app.db | Bin 20480 -> 20480 bytes docker/nginx/conf.d/default.conf | 20 +++++++++++++------- frontend/vite.config.ts | 2 +- 4 files changed, 19 insertions(+), 12 deletions(-) diff --git a/backend/run.py b/backend/run.py index 227ba7c..8a0a863 100644 --- a/backend/run.py +++ b/backend/run.py @@ -9,10 +9,11 @@ logger = getLogger(__name__) async def run_bot(): """Run Telegram bot""" - try: - await start_bot() - except Exception as e: - logger.error(f"Bot crashed: {e}", exc_info=True) + print("Bot started") + # try: + # await start_bot() + # except Exception as e: + # logger.error(f"Bot crashed: {e}", exc_info=True) async def run_api(): diff --git a/backend/sql_app.db b/backend/sql_app.db index c84cae520dfc2dc4a91a90a4ece64a25d659433c..61da5cf12ac217ffd091197655f3757d2ea66e29 100644 GIT binary patch delta 116 zcmZozz}T>Wae_3X=R_H2M$e52OZ1tQ*=|l|H*jTQyScHkn~lj_c`~=Pywd&)8!l`z zGB7gHH8j#SGF31zurjm&B6B5921a37Nny#!4=ltdXPXOeb~E3{!K}=0Fqz%Km5JYA Uv!cQyJ~mcnMn+}j$!7ki0L6+QumAu6 delta 76 zcmV-S0JHyqpaFoO0gxL3NRb>v0Z6f6q%Q*^2NIJ9Fh#L}#s&&EA_)Ki6CD{78I#~R i7n5r@6SGD)z6b*%4>pqrKt;15AnFd2Fi!-NI#0$sR~7C6 diff --git a/docker/nginx/conf.d/default.conf b/docker/nginx/conf.d/default.conf index b2de9ee..2f9331c 100644 --- a/docker/nginx/conf.d/default.conf +++ b/docker/nginx/conf.d/default.conf @@ -1,16 +1,16 @@ server { listen 80; server_name localhost; + + root /usr/share/nginx/html; + index index.html; + # Настройка для SPA - все запросы направляются на index.html location / { - proxy_pass http://frontend; - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection 'upgrade'; - proxy_set_header Host $host; - proxy_cache_bypass $http_upgrade; + try_files $uri $uri/ /index.html; } + # Проксирование API запросов на бэкенд location /api/ { proxy_pass http://backend:8000; proxy_http_version 1.1; @@ -19,4 +19,10 @@ server { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } -} + + # Настройка кеширования для статических файлов + location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { + expires max; + log_not_found off; + } +} \ No newline at end of file diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 180520b..972c4b0 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -12,7 +12,7 @@ export default defineConfig({ server: { proxy: { '/api': { - target: 'http://185.139.70.62:80', + target: 'http://localhost:8000', changeOrigin: true } }