undertow

Spring Boot with Embedded Undertow behind AWS ELB - HTTP to HTTPS redirect

折月煮酒 提交于 2019-11-26 22:10:25
问题 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 but none using Undertow. I have tried this, with a second port 8089, and it does redirect as required, but

How to configure Wildfly to serve static content (like images)?

南楼画角 提交于 2019-11-26 17:15:11
I have a JavaEE application running on Wildfly 8.0.0 Final. The application uses a lot of images and I don't want to store them in the database, so they are written to the hard disk. How can I configure Wildfly/Undertow in order to serve these files (/var/images) on a certain URL, for example http://localhost:8080/myapplication/imagesFromDisk ? Add another file handler and another location to the undertow subsystem in standalone.xml: <server name="default-server"> <http-listener name="default" socket-binding="http"/> <host name="default-host" alias="localhost"> <location name="/" handler=