如何在Spring应用程序中让同一个端口监听http和https请求

问题描述 投票:0回答:1

我想要一种方法让端口7001同时处理http和https请求

server:
  port: 7001
  ssl:
    enabled: true
    key-store: classpath:www.jipd.org
    key-store-type: PKCS12
    key-store-password: L87qGQctdD2J
  http:
    port: 7002

eureka:
  instance:
    prefer-ip-address: true
  client:
    serviceUrl:
      defaultZone: http://naming-server:8761/eureka

我试过这个>>>对吗?

server:
  port: 7001
  ssl:
    enabled: true
    key-store: classpath:www.jipd.org
    key-store-type: PKCS12
    key-store-password: L87qGQctdD2J
  http:
    port: 7001
java spring http https api-gateway
1个回答
0
投票

在 application.properties 文件中

server.port=8081

或在 application.yml 文件中:

server:
port : 8081

那么你使用什么 application.properties 或 application.yml ??

© www.soinside.com 2019 - 2024. All rights reserved.