SpringBoot 避免重定向到 HTTPS 的方法 - server.tomcat.redirect-context-root 属性详解
在 Spring Boot 中,可以使用 `server.tomcat.redirect-context-root` 属性来将重定向的 https 变成 http。\n\n设置 `server.tomcat.redirect-context-root` 为 `false` 时,不会重定向到 https,而是保持 http 连接。\n\n例如,可以在 `application.properties` 文件中添加以下配置:\n\n\nserver.tomcat.redirect-context-root=false\n\n\n或者在 `application.yml` 文件中添加以下配置:\n\nyaml\nserver:\n tomcat:\n redirect-context-root: false\n
原文地址: https://www.cveoy.top/t/topic/pLkA 著作权归作者所有。请勿转载和采集!