diff --git a/nginx/rythmify.duckdns.org.conf b/nginx/rythmify.duckdns.org.conf index 1596af0..2f33897 100644 --- a/nginx/rythmify.duckdns.org.conf +++ b/nginx/rythmify.duckdns.org.conf @@ -19,6 +19,37 @@ server { root /var/www/rythmify; index index.html; + # Backend API + location /api/ { + proxy_pass http://localhost:8080/api/; + + 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; + } + + # WebSocket support + location /socket.io/ { + proxy_pass http://localhost:8080/socket.io/; + + proxy_http_version 1.1; + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $host; + } + + # Grafana (MUST KEEP) + location /grafana/ { + proxy_pass http://localhost:3000/; + + proxy_http_version 1.1; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + } + + # Frontend SPA location / { try_files $uri $uri/ /index.html; }