lttcai-ui.conf 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. server {
  2. listen 80;
  3. server_name localhost;
  4. gzip on;
  5. gzip_static on; # 需要http_gzip_static_module 模块
  6. gzip_min_length 1k;
  7. gzip_comp_level 4;
  8. gzip_proxied any;
  9. gzip_types text/plain text/xml text/css text/event-stream; # 添加 text/event-stream;
  10. gzip_vary on;
  11. gzip_disable "MSIE [1-6]\.(?!.*SV1)";
  12. # 前端打包好的dist目录文件
  13. root /data/;
  14. location ^~/api/ {
  15. proxy_pass http://lttcai-gateway:9999/; #注意/后缀
  16. proxy_connect_timeout 60s;
  17. proxy_read_timeout 120s;
  18. proxy_send_timeout 120s;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header X-Forwarded-Proto http;
  22. proxy_http_version 1.1;
  23. proxy_set_header Upgrade $http_upgrade;
  24. proxy_set_header Connection "upgrade";
  25. proxy_set_header Host $http_host;
  26. proxy_set_header from "";
  27. # 为服务端推送事件(SSE)禁用缓冲
  28. proxy_buffering off;
  29. proxy_cache off;
  30. }
  31. }