I'm running a Spring boot (Jhipster/Undertow) application on port 8080 on an AWS EC2 instance.

I have an AWS ELB configured to redirect

```
 80 -> 8080
 443 (SSL termination happens here) -> 8080

```

The application uses Spring Security and if you user arrives to <http://example.com> I want it to redirect to <https://example.com>, to use SSL.

I have found various examples of configuring this in [Tomcat](https://stackoverflow.com/questions/30229352/spring-boot-with-embedded-tomcat-behind-aws-elb-https-redirect) but none using Undertow.

I have tried this, with a second port 8089, and it does redirect as required, but this causes port 8080 to also redirects which I don't want.

```
80 -> 8089
443 (SSL termination happens here) -> 8080

```

```java
@Bean
public EmbeddedServletContainerFactory undertow() {

    UndertowEmbeddedServletContainerFactory undertow = new UndertowEmbeddedServletContainerFactory();
    undertow.addBuilderCustomizers(builder -> builder.addHttpListener(8089, "0.0.0.0"));
    undertow.addDeploymentInfoCustomizers(deploymentInfo -> {
        deploymentInfo.addSecurityConstraint(new SecurityConstraint()
                .addWebResourceCollection(new WebResourceCollection()
                        .addUrlPattern("/*"))
                .setTransportGuaranteeType(TransportGuaranteeType.CONFIDENTIAL)
                .setEmptyRoleSemantic(SecurityInfo.EmptyRoleSemantic.PERMIT))
                .setConfidentialPortManager(exchange -> 443);
    });
    return undertow;
}

```

How can I configure Undertow to achieve this?