nacos中服务默认ip为内网ip导致同一项目在不同服务器上的微服务无法通过网关访问

解决办法:
在一台服务器中的哪几个服务的yml中加入:

spring:
  cloud:
    nacos:
      discovery:
        ip: xxx.xx.x.x

或者properties文件中加入:

spring.cloud.nacos.discovery.ip =xxxx

关于这个字段的官方文档:

The ip address your want to register for your service instance, needn’t to set it if the auto detect ip works well

在这里插入图片描述


版权声明:本文为zimojiang原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。