Search code examples
springdocspringdoc-openui

springdoc-openapi-ui How do I set the request to HTTPS


When I publish, I will use HTTPS requests instead of HTTP, but swagger original URL is still HTTP, I have no idea how to set it up, and there is no documentation for servers in the original springdoc-openapi-ui configuration

https://springdoc.org/index.html#properties enter image description here


Solution

  • I solved the problem by modifying the Nginx configuration and the Spring-boot configuration(application.properties)

    nginx-conf:

    proxy_set_header        X-Forwarded-Proto $scheme;
    

    spring-boot (application.properties):

    server.forward-headers-strategy=framework
    

    https://github.com/springdoc/springdoc-openapi/issues/171