升级文档.txt 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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. 在spring.cloud.gateway节点下增加以下配置:
  23. httpclient:
  24. websocket:
  25. max-frame-payload-length: 5242880
  26. 例:
  27. spring:
  28. cloud:
  29. gateway:
  30. httpclient:
  31. websocket:
  32. max-frame-payload-length: 5242880
  33. 2、nacos gateway配置文件增加-部署中心不校验白名单:
  34. security:
  35. ignore:
  36. whites:
  37. - /api/deploy/register
  38. - /api/deploy/accesstoken
  39. - /api/deploy/package/download/**
  40. - /api/deploy/agent/download/**
  41. - /api/deploy/frontend/synchronDate
  42. - /api/deploy/heartbeat
  43. - /api/deploy/list
  44. - /api/deploy/report
  45. - /api/deploy/task
  46. - /api/deploy/taskReport
  47. - /ws/**
  48. - /ws1/**
  49. 3.nginx配置文件修改
  50. 3.1在监听8080的 server块下增加配置:
  51. location /ws {
  52. proxy_pass http://api;
  53. proxy_http_version 1.1;
  54. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  55. proxy_set_header Upgrade $http_upgrade;
  56. proxy_set_header Connection "upgrade";
  57. proxy_set_header Host $host;
  58. }
  59. 3.2在监听8080的 server块下 location @api { 这一行下一行追加两行代码:
  60. proxy_set_header X-Local-Ip $host;
  61. proxy_set_header X-Local-Port $server_port;
  62. 3.3 修改http下配置 client_max_body_size 大小
  63. client_max_body_size 2048M;
  64. 3.4 重新加载配置文件:
  65. 在nginx的安装目录下的sbin目录执行命令: ./nginx -s reload
  66. 4.修改上传文件大小-在nacos application-dev.yml中修改
  67. spring:
  68. servlet:
  69. multipart:
  70. max-file-size: 2048MB