nginx.dev.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. server {
  2. listen 80;
  3. server_name _;
  4. location / {
  5. proxy_set_header X-Real-IP $remote_addr;
  6. proxy_set_header X-Forwarded-For $remote_addr;
  7. proxy_set_header Host $host;
  8. proxy_http_version 1.1;
  9. proxy_set_header Upgrade $http_upgrade;
  10. proxy_set_header Connection "upgrade";
  11. proxy_redirect off;
  12. proxy_pass http://localhost:81;
  13. }
  14. location /backend {
  15. proxy_set_header X-Real-IP $remote_addr;
  16. proxy_set_header X-Forwarded-For $remote_addr;
  17. proxy_set_header Host $host;
  18. proxy_http_version 1.1;
  19. proxy_set_header Upgrade $http_upgrade;
  20. proxy_set_header Connection "upgrade";
  21. proxy_redirect off;
  22. rewrite ^/backend/?(.*) /$1 break;
  23. proxy_pass http://backend:8080;
  24. }
  25. location /api {
  26. proxy_set_header X-Real-IP $remote_addr;
  27. proxy_set_header X-Forwarded-For $remote_addr;
  28. proxy_set_header Host $host;
  29. proxy_http_version 1.1;
  30. proxy_set_header Upgrade $http_upgrade;
  31. proxy_set_header Connection "upgrade";
  32. proxy_redirect off;
  33. rewrite ^/api/?(.*) /$1 break;
  34. proxy_pass http://server:3030;
  35. }
  36. }