升级文档.txt 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 Upgrade $http_upgrade;
  44. proxy_set_header Connection "upgrade";
  45. proxy_set_header Host $host;
  46. }
  47. 3.2在监听8080的 server块下 location @api { 这一行下一行追加两行代码:
  48. proxy_set_header X-Local-Ip $host;
  49. proxy_set_header X-Local-Port $server_port;
  50. 3.3 重新加载配置文件:
  51. 在nginx的安装目录下的sbin目录执行命令: ./nginx -s reload