Spring Boot redirect port 8080 to 8443
In Spring Boot 2.x, we can create a ServletWebServerFactory to redirect a port from HTTP 8080 to HTTPS 8443. Access localhost:8080, it will redirect to localhost:8443 1. ServletWebServerFactory For Spring Boot 2.x, try this: pom.xml <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> StartApplication.java package com.mkyong; import org.apache.catalina.Context; import org.apache.catalina.connector.Connector; import org.apache.tomcat.util.descriptor.web.SecurityCollection; import org.apache.tomcat.util.descriptor.web.SecurityConstraint; import …