2.7.1.RELEASE Boot版 ,本地访问正常f访问接口文档,发布到线上无法访问

Blade 已结 2 1061
will
will 剑圣 2021-01-29 17:07
悬赏:5

一、该问题的重现步骤是什么?

  本地运行:

image.png

线上运行:

image.png


二、你期待的结果是什么?实际看到的又是什么?


三、你正在使用的是什么产品,什么版本?在什么操作系统上?

版本:2.7.1.RELEASE Boot版 。本地win10  线上centos8

四、请提供详细的错误堆栈信息,这很重要。


五、若有更多详细信息,请在下面提供。


配置文件:

#knife4j配置
knife4j:
 #启用
 enable: true
 #基础认证
 basic:
   enable: false
   username: blade
   password: blade
 #增强配置
 setting:
   enableSwaggerModels: true
   enableDocumentManage: true
   enableHost: false
   enableHostText: http://localhost
   enableRequestCache: true
   enableFilterMultipartApis: false
   enableFilterMultipartApiMethodType: POST
   language: zh-CN
   enableFooter: false
   enableFooterCustom: true
   footerCustomContent: Copyright © 2020 BladeX All Rights Reserved

#swagger公共信息
swagger:
 title: 用户端接口文档
 description: 用户端接口文档
 version: 2.7.1.RELEASE
 license: Powered By BladeX
 license-url: http://xxxxxxxxxxx.com
 terms-of-service-url: http://xxxxxxx/api
 contact:
   name: Will
   email: will@idwsoft.com
   url:

2条回答
  •  admin
    admin (最佳回答者)
    2021-01-29 18:26

    prod环境启动是默认关闭访问的,你可以用test或者其他的环境变量指定启动,但是不要用prod

    作者追问:2021-01-29 18:26

    OK , 更换环境变量可以了.THX.

    1 讨论(1)
  • 2021-01-29 17:34

    不使用  knife4j 就可以了。 

    application.yml

    image.png



    0 讨论(0)
提交回复