I am completely new to haproxy setup. I want to setup haproxy on top of tomcat servers.
The below configuration works well for tomcat applications.
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
user haproxy
group haproxy
defaults
log global
mode http
option httplog
option dontlognull
retries 3
option redispatch
maxconn 20000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen webfarm 100.100.100.100:80
mode http
stats enable
stats uri /haproxy?statis
stats realm Haproxy\ Auth
stats auth user:password
balance leastconn
cookie JSESSIONID insert indirect nocache
option httpclose
option forwardfor
server web01 192.168.1.1:8080 cookie A check
server web02 192.168.1.2:8080 cookie B check
But i dont want user to enter the complete url. so when a user hits web1.example.com it need to server application from a tomcat webapp directory. Also i dont want the url changed.
Example : http://web1.example.com -> http://192.168.1.1:8080/applications/web1 & http://192.168.1.2:8080/applications/web1
Is this possible with a url redirection and url rewriting? If yes please help me with a sample configuration.
Any help will be really appreciated.
Thanks