升级文档.txt 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. 1、nacos gateway配置文件增加-部署中心路由节点:
  2. spring:
  3. cloud:
  4. gateway:
  5. routes:
  6. # 部署中心服务
  7. - id: soc-deploy
  8. uri: lb://soc-deploy
  9. predicates:
  10. - Path=/api/delpoy/**
  11. filters:
  12. - StripPrefix=2
  13. # websocket模块
  14. - id: soc-websocket
  15. uri: lb:ws://soc-mediator
  16. predicates:
  17. - Path=/ws/**
  18. - id: soc-websocket
  19. uri: lb:ws://soc-mediator
  20. predicates:
  21. - Path=/ws1/**
  22. 2、nacos gateway配置文件增加-部署中心不校验白名单:
  23. security:
  24. ignore:
  25. whites:
  26. - /api/deploy/register
  27. - /api/deploy/accesstoken
  28. - /api/deploy/package/download/**
  29. - /api/deploy/agent/download/**
  30. - /api/deploy/frontend/synchronDate
  31. - /api/deploy/heartbeat
  32. - /api/deploy/list
  33. - /api/deploy/report
  34. - /api/deploy/task
  35. - /api/deploy/taskReport
  36. - /ws/**
  37. - /ws1/**
  38. 3.nginx配置文件修改
  39. 3.1在监听8080的 server块下增加配置:
  40. location /ws {
  41. proxy_pass http://api;
  42. proxy_http_version 1.1;
  43. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  44. proxy_set_header Upgrade $http_upgrade;
  45. proxy_set_header Connection "upgrade";
  46. proxy_set_header Host $host;
  47. }
  48. 3.2在监听8080的 server块下 location @api { 这一行下一行追加两行代码:
  49. proxy_set_header X-Local-Ip $host;
  50. proxy_set_header X-Local-Port $server_port;
  51. 3.3 修改http下配置 client_max_body_size 大小
  52. client_max_body_size 2048M;
  53. 3.4 重新加载配置文件:
  54. 在nginx的安装目录下的sbin目录执行命令: ./nginx -s reload
  55. 4.修改上传文件大小-在nacos application-dev.yml中修改
  56. spring:
  57. servlet:
  58. multipart:
  59. max-file-size: 2048MB