# HAProxy SSL Termination with differents ports, it's possible?

**URL:** <https://discourse.haproxy.org/t/haproxy-ssl-termination-with-differents-ports-its-possible/113>\
**Category:** Help!\
**Created:** [February 15, 2016, 1:18pm UTC](https://discourse.haproxy.org/t/haproxy-ssl-termination-with-differents-ports-its-possible/113 "2016-02-15T13:18:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tantunes](https://avatars.discourse-cdn.com/v4/letter/t/898d66/32.png) [@tantunes](https://discourse.haproxy.org/u/tantunes)\
**Post date:** [February 15, 2016, 1:18pm UTC](https://discourse.haproxy.org/t/haproxy-ssl-termination-with-differents-ports-its-possible/113/1 "2016-02-15T13:18:59Z")

</div>

First, overview architecture:

—\> https —\> Apache --\> https:7145 --\> Balance (Haproxy):7145 --\> backend:7145 (tomcat https).

1. The connection https incoming in apache:  
#Framework  
ProxyPass /token [https://balance:7145/token](https://balance:7145/token) smax=5 max=10 ttl=120 retry=300  
ProxyPassReverse /token [https://balance:7145/token](https://balance:7145/token)

2. haproxy conf

frontend https  
bind 172.17.37.93:7145 ssl crt /etc/httpd/certificados/apiqlt/apiqlt.ogmaster.local.pem ( contains a cert for all the domains you want to host, or a wildcard cert that covers them)  
mode http  
default\_backend server\_https

backend server\_https

# redirect scheme https if !{ ssl\_fc }

```
    mode http
    server server1 172.17.35.231:7145 check

```

1. The problem is that https is in different port and encrypts who is apache
2. Like the haproxy made only brige the https connection, it’s possible ? with diffents ports https ?
3. I tested with tcp mode without success for ssl backends
