SpringBoot整合Eureka注册页面进入Whitelabel Error Page

今天配置EurekaServer时发现运行不出错,但是进不去注册中心,后来发现原来是我用了maven的默认项目来配置,如果使用webapp骨架就可以正常访问了。。
贴上配置文件:
application.yml

#定义服务应用名称
spring:
  application:
    name: eureka-server
  freemarker:
    prefer-file-system-access: false

server:
  port: 10086

#定义eureka服务端
eureka:
  instance:
    hostname: localhost
  client:
    register-with-eureka: false # 是否注册自己的信息到EurekaServer,默认是true
    fetch-registry: false
    service-url: # EurekaServer的地址,现在是自己的地址,如果是集群,需要加上其它Server的地址。
      defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/

Eureka服务端启动类

@SpringBootApplication
@EnableEurekaServer
public class StartMain {
    public static void main(String[] args) {
        SpringApplication.run(StartMain.class,args);
    }
}

访问注册中心页面:
http://localhost:10086/

猜你喜欢

转载自blog.csdn.net/zhou373986278/article/details/88640326