nginx.conf 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. server {
  2. listen 80;
  3. server_name radionica3d.me www.radionica3d.me 148.230.71.134;
  4. root /usr/share/nginx/html;
  5. index index.html;
  6. # Gzip Compression
  7. gzip on;
  8. gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
  9. location / {
  10. try_files $uri $uri/ /index.html;
  11. }
  12. # Proxy API requests to backend
  13. location /api/ {
  14. proxy_pass http://localhost:8000/;
  15. proxy_set_header Host $host;
  16. proxy_set_header X-Real-IP $remote_addr;
  17. }
  18. # Standalone Deploy Webhook
  19. location /deploy-webhook {
  20. proxy_pass http://127.0.0.1:9000;
  21. proxy_set_header Host $host;
  22. }
  23. # WebSocket requests
  24. location /ws/ {
  25. proxy_pass http://localhost:8000/ws/;
  26. proxy_http_version 1.1;
  27. proxy_set_header Upgrade $http_upgrade;
  28. proxy_set_header Connection "Upgrade";
  29. proxy_set_header Host $host;
  30. }
  31. # Static uploads (if served via Nginx instead of FastAPI)
  32. location /uploads/ {
  33. alias /app/uploads/;
  34. expires 7d;
  35. add_header Cache-Control "public";
  36. }
  37. }