fix(docker): resolve nginx and backend path configuration issues
All checks were successful
continuous-integration/drone/push Build is passing

- Add nginx/default.conf with simplified configuration to fix "no events section" error
- Update docker-compose.yml to mount nginx/default.conf instead of nginx.conf
- Fix backend/daemons.py data path from backend/data/daemons.json to data/daemons.json
- Improve users.json path detection with fallback logic in daemons.py
- Add servers directory to .gitignore
- Create DOCKER_FIX.md documentation with troubleshooting steps and solutions
- Ensure data directory is created automatically when backend starts
This commit is contained in:
2026-01-17 10:32:46 +06:00
parent d188cec1f0
commit e02789ef53
5 changed files with 245 additions and 3 deletions

62
nginx/default.conf Normal file
View File

@@ -0,0 +1,62 @@
upstream mc_panel {
server mc-panel:8000;
}
server {
listen 80;
server_name _;
client_max_body_size 100M;
# API endpoints
location /api/ {
proxy_pass http://mc_panel;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
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_set_header X-Forwarded-Proto $scheme;
proxy_cache_bypass $http_upgrade;
# Таймауты
proxy_connect_timeout 60s;
proxy_send_timeout 60s;
proxy_read_timeout 60s;
}
# WebSocket для консоли
location /ws/ {
proxy_pass http://mc_panel;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
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_set_header X-Forwarded-Proto $scheme;
# WebSocket таймауты
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
}
# Статические файлы фронтенда
location / {
proxy_pass http://mc_panel;
proxy_http_version 1.1;
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_set_header X-Forwarded-Proto $scheme;
}
# Health check
location /health {
access_log off;
return 200 "healthy\n";
add_header Content-Type text/plain;
}
}