prod.nginx.conf 829 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. worker_processes 1;
  2. events {
  3. worker_connections 1024;
  4. }
  5. http {
  6. include /etc/nginx/mime.types;
  7. default_type application/octet-stream;
  8. sendfile off;
  9. keepalive_timeout 65;
  10. server {
  11. listen 80;
  12. server_name _;
  13. root /opt/app/build;
  14. location / {
  15. try_files $uri /$uri /index.html =404;
  16. }
  17. location /backend {
  18. proxy_set_header X-Real-IP $remote_addr;
  19. proxy_set_header X-Forwarded-For $remote_addr;
  20. proxy_set_header Host $host;
  21. proxy_http_version 1.1;
  22. proxy_set_header Upgrade $http_upgrade;
  23. proxy_set_header Connection "upgrade";
  24. proxy_redirect off;
  25. rewrite ^/backend/?(.*) /$1 break;
  26. proxy_pass http://backend:8080;
  27. }
  28. }
  29. }