nginx.conf 645 B

12345678910111213141516171819202122232425
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. # Serve Static Files
  5. location / {
  6. root /usr/share/nginx/html;
  7. index index.html index.htm;
  8. try_files $uri $uri/ /index.html;
  9. }
  10. # Proxy API requests to Backend
  11. location /api/ {
  12. proxy_pass http://backend:8000/api/;
  13. proxy_set_header Host $host;
  14. proxy_set_header X-Real-IP $remote_addr;
  15. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  16. # WebSocket Support
  17. proxy_http_version 1.1;
  18. proxy_set_header Upgrade $http_upgrade;
  19. proxy_set_header Connection "upgrade";
  20. }
  21. }