default.conf 729 B

1234567891011121314151617181920212223242526
  1. server {
  2. listen 80;
  3. server_name _; # 修改为自定义的访问域名
  4. root /var/www/build/;
  5. location ^~ /api/ {
  6. rewrite ^/api(.*) $1 break;
  7. proxy_pass http://127.0.0.1:9001;
  8. proxy_redirect off;
  9. proxy_set_header X-Real-IP $remote_addr;
  10. }
  11. location ^~ /api/ws/ {
  12. rewrite ^/api(.*) $1 break;
  13. proxy_pass http://127.0.0.1:9002;
  14. proxy_http_version 1.1;
  15. proxy_set_header Upgrade $http_upgrade;
  16. proxy_set_header Connection "Upgrade";
  17. proxy_set_header X-Real-IP $remote_addr;
  18. }
  19. error_page 404 /index.html;
  20. }