nginx.conf 941 B

123456789101112131415161718192021222324252627282930313233
  1. server {
  2. listen 80;
  3. server_name _;
  4. root /usr/share/nginx/html;
  5. index index.html;
  6. location /api/ {
  7. proxy_pass http://backend:8000/;
  8. proxy_http_version 1.1;
  9. proxy_set_header Host $host;
  10. proxy_set_header X-Real-IP $remote_addr;
  11. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  12. proxy_set_header X-Forwarded-Proto $scheme;
  13. }
  14. location /ws/ {
  15. proxy_pass http://backend:8000/ws/;
  16. proxy_http_version 1.1;
  17. proxy_set_header Upgrade $http_upgrade;
  18. proxy_set_header Connection "upgrade";
  19. proxy_set_header Host $host;
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  22. proxy_set_header X-Forwarded-Proto $scheme;
  23. proxy_read_timeout 3600s;
  24. proxy_send_timeout 3600s;
  25. }
  26. location / {
  27. try_files $uri /index.html;
  28. }
  29. }