Skip to content

oglimmer/tomcat-behind-reverse-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tomcat behind a Reverse-Proxy

This is the project related to the medium article on https://oglimmer.medium.com/tomcat-behind-a-reverse-proxy-64666ec2f2be

Limitations

As the docker documentation tells us (here) network=host only works on Linux, thus this project has a linux or a macOS-windows folders.

Only on Linux you will see the actual source IP behind haproxy, anyhow you can still run this project on macOS or Windows, but you will always see the docker's network gateway IP as the source IP - just use your imagination in this case ;)

How to run

docker-compose up --build

Modify your /etc/hosts by adding 127.0.0.1 tomcat.local.

You might also want to import haproxy/cert.pem to your Browser's trusted certificates.

Linux:

Then access at http://localhost/myapp/ or http://tomcat.local/myapp/

macOS / Windows

Then access at http://localhost:8000/myapp/ or http://tomcat.local:8443/myapp/

Configurations

See tomcat/Dockerfile for different configurations.