nginx.prod.conf 966 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. server {
  2. listen 80;
  3. server_name _;
  4. root /usr/share/nginx/html;
  5. location / {
  6. try_files $uri /$uri /index.html =404;
  7. }
  8. location /backend {
  9. proxy_set_header X-Real-IP $remote_addr;
  10. proxy_set_header X-Forwarded-For $remote_addr;
  11. proxy_set_header Host $host;
  12. proxy_http_version 1.1;
  13. proxy_set_header Upgrade $http_upgrade;
  14. proxy_set_header Connection "upgrade";
  15. proxy_redirect off;
  16. rewrite ^/backend/?(.*) /$1 break;
  17. proxy_pass http://backend:8080;
  18. }
  19. location /api {
  20. proxy_set_header X-Real-IP $remote_addr;
  21. proxy_set_header X-Forwarded-For $remote_addr;
  22. proxy_set_header Host $host;
  23. proxy_http_version 1.1;
  24. proxy_set_header Upgrade $http_upgrade;
  25. proxy_set_header Connection "upgrade";
  26. proxy_redirect off;
  27. rewrite ^/api/?(.*) /$1 break;
  28. proxy_pass http://server:3030;
  29. }
  30. }