Hi,
Here is our haproxy setup and haproxy setup and ha proxy is just acting proxy server(no load balancing)
example confguration
frontend http-in-ssl
bind *:80
bind *:443 ssl crt /etc/haproxy/ssl
log 127.0.0.1 local1 notice
option httplog
reqadd X-Forwarded-Proto:\ https
reqadd X-Forwarded-Proto:\ http
acl alpha hdr(host) -i alpha.example.com
acl beta hdr(host) -i beta.example.com
redirect scheme https if !{ ssl_fc } alpha
redirect scheme https if !{ ssl_fc } beta
use_backend alpha-backend if { ssl_fc_sni alpha.verizon.com }
use_backend beta-backend if { ssl_fc_sni beta.verizon.com }
backend alpha-backend
server alpha-server-server 192.168.1.100:8080 check inter 2000 maxconn 500 rise 2 fall 3
backend beta-backend
server beta-server-server 192.168.1.200:8090 check inter 2000 maxconn 500 rise 2 fall 3
==This is working fine if any one hits to the haproxy from external IP. Even curl is working fine when i exececute curl from my computer.
But When i try to curl alpha.example.com from beta.example.com it is not working. Here is the out put i am getting
root@test-betahost:~# curl -vvv -L http://beta.example.com
- Rebuilt URL to: http:/beta.example.com/
- Hostname was NOT found in DNS cache
- Trying 192.168.1.10…
- Connected to beta.example.com (192.168.1.10) port 80 (#0)
GET / HTTP/1.1
User-Agent: curl/7.35.0
Host: beta.example.com
Accept: /
< HTTP/1.1 302 Found
< Cache-Control: no-cache
< Content-length: 0
< Location: https://beta.example.com/
< Connection: close
<
- Closing connection 0
- Issue another request to this URL: ‘https://beta.example.com/’
- Hostname was NOT found in DNS cache
- Trying 159.67.198.2…
- Connected to proxy.ebiz.example.com (132.67.190.200) port 80 (#1)
- Establish HTTP proxy tunnel to beta.example.com:443
CONNECTbeta.example.com:443 HTTP/1.1
Host: beta.example.com:443
User-Agent: curl/7.35.0
Proxy-Connection: Keep-Alive
< HTTP/1.1 503 Service Unavailable
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Type: text/html; charset=utf-8
< Proxy-Connection: close
< Connection: close
< Content-Length: 1019
<
- Received HTTP code 503 from proxy after CONNECT
- Connection #1 to host proxy.ebiz.example.com left intact
curl: (56) Received HTTP code 503 from proxy after CONNECT
Could some one please help me for this?