gateway项目集成eureka项目后,无法跳转到百度页面

gateway项目集成eureka项目后,无法跳转到百度页面,跳转localhost是可以的

代码如下:
gateway网关项目配置如下:

server:
  port: 9527
# 测试将所有请求跳转到百度页面
spring:
  application:
    name: gateway
  cloud:
    gateway:
      discovery:
        locator:
          enabled: false
      routes:
        - id: baidu #payment_route    #路由的ID,没有固定规则但要求唯一,建议配合服务名
          uri: https://www.baidu.com/ #匹配后提供服务的路由地址
          predicates:
            - Path=/         # 断言,路径相匹配的进行路由

eureka:
  instance:
    hostname: cloud-gateway
  client:
    service-url:
      # false表示不向注册中心注册自己。
      register-with-eureka: true
      # false表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务
      fetch-registry: true
#      defaultZone: http://eureka7001.com:7001/eureka
      defaultZone: http://localhost:7001/eureka
@SpringBootApplication
@EnableEurekaClient
public class GatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(GatewayApplication.class, args);
    }


}

pom文件如下:


<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0modelVersion>
    <parent>
        <groupId>org.springframework.bootgroupId>
        <artifactId>spring-boot-starter-parentartifactId>
        <version>2.1.4.RELEASEversion>
        <relativePath/> 
    parent>
    <groupId>com.example.csdngroupId>
    <artifactId>gatewayartifactId>
    <version>0.0.1-SNAPSHOTversion>
    <name>gatewayname>
    <description>Demo project for Spring Bootdescription>
    <properties>
        <java.version>1.8java.version>
    properties>
    <dependencies>

        <dependency>
            <groupId>org.springframework.bootgroupId>
            <artifactId>spring-boot-starter-testartifactId>
            <scope>testscope>
        dependency>

        <dependency>
            <groupId>org.projectlombokgroupId>
            <artifactId>lombokartifactId>
            <version>1.18.6version>
        dependency>



        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-gatewayartifactId>
            <version>2.1.4.RELEASEversion>
        dependency>

        
        
        
        <dependency>
            <groupId>org.springframework.cloudgroupId>
            <artifactId>spring-cloud-starter-netflix-eureka-clientartifactId>
            <version>2.1.4.RELEASEversion>
        dependency>

    dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.bootgroupId>
                <artifactId>spring-boot-maven-pluginartifactId>
                <version>2.1.4.RELEASEversion>
            plugin>
        plugins>
    build>

project>


注册中心配置:

server:
  port: 7001

eureka:
  instance:
#    hostname: eureka7001.com #eureka服务端的实例名称
    hostname: localhost #eureka服务端的实例名称
  client:
    #false表示不向注册中心注册自己。
    register-with-eureka: false
    #false表示自己端就是注册中心,我的职责就是维护服务实例,并不需要去检索服务
    fetch-registry: false
    service-url:
      #设置与Eureka Server交互的地址查询服务和注册服务都需要依赖这个地址。
#      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/
  server:
#    enable-self-preservation: false
    eviction-interval-timer-in-ms: 2000


设备dns需要配置外网的,不然解析不了百度