I'm searching for a solution to be able to run a Spring application behind an Apache SSL proxy. I tried a lot of configurations without success. All Spring responses go to http causing a Not Found error.
The following is apache configuration:
These are the Spring options:
I'm using Spring Boot 2.5.6 on Apache Tomcat/9.0.54. The OS Apache is a 2.4.25 version running on a Debian 9.13.
The problem seems to happen after login into the application and logout. If I substitute http to https after the login action, I'm able to navigate into the application. All links works fine until I logout. When I logout the application goes again to http.
Roland Mueller wrote:
I guess the approach to have Java or other servers behind a Webserver such as Apache or Nginx is not a new concept and will not be subject of many changes or radical changes.
The concept is known as a reverse proxy and is probably older than some of the people on the Ranch at this point. You'll often hear it simply called "proxy", but a true web proxy acts as a single access point for outbound requests. A Reverse Proxy acts as a client for inbound requests.
Probably the most popular "proxy" servers are Apache, Nginx, and IIS, although others can also serve. Or you can use a physical proxy server device such as the popular F5 line.
Apache uses modules and there are several. The mod_jk module talks to Tomcat workers and in theory should be better for load balancing, but mod_proxy is the generally-recommended one. They don't connect to port 8080, but rather to the Tomcat proxy port (8009) and use private (coyote) protocols. The SSL connection is between the outside and Apache. Normally one trusts that the DMZ side of Apache is secure enough to go directly to Tomcat.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"