Single haproxy instance running on http as well as tcp mode

I have two web applications running on a server inside two separate docker containers, one of them is running on play framework server (java), while other is running on nginx (php). I am doing ssl termination in http mode at haproxy for the play app. I want to handle the ssl termination for other app at nginx.
Is it possible to configure haproxy in such a way, so that one front-end forwards the request in tcp mode, and another in http mode. Below is how my haproxy.cfg would look like.

frontend http-in
        mode http
        bind *:80
        redirect scheme https code 301 if !{ ssl_fc }


frontend https-in
#        bind *:80
        bind *:443 ssl crt /etc/ssl/certs/my_certificate_file.pem
        reqadd X-Forwarded-Proto:\ https
#        redirect scheme https code 301 if !{ ssl_fc }
        mode http
        option httpclose
        option forwardfor
        # Define hosts based on domain names
        acl host_test_ssh hdr(host) -i playapp.domain.com

        ## figure out backend to use based on domainname
        use_backend testssh if host_test_ssh

frontend http-in-other
        bind *:80
        mode tcp
        option tcplog
        redirect scheme https if !{ ssl_fc }

frontend https-in-estore
        bind *:443
        mode tcp
        option tcplog
        # Define hosts based on domain names
        acl host_test_ssh hdr(host) -i nginxapp.domain2.com

        ## figure out backend to use based on domainname
        use_backend other if host_test_ssh

  • Overriding inherited CMD in Dockerfile does not always work?
  • What does Docker add to lxc-tools (the userspace LXC tools)?
  • How can I configure logtash to use “stdout” as input?
  • Docker - var/lib/docker/layers folder content
  • How to access to container's logs via GET request to the NodeJS/express?
  • What causes BitBake worker processes to exit unexpectedly?
  • golang net.LookupHost in docker container return 127.0.53.53
  • docker global service and replicated service performance
  • Docker not running/showing long-running processes
  • Artifactory docker registry docker image
  • How to install nvm in a Dockerfile?
  • rg.apache.spark.SparkException: Invalid master URL: spark://tasks.501393358-spark-master:7077
  • One Solution collect form web for “Single haproxy instance running on http as well as tcp mode”

    I have not tried this but based on the documentation of 1.5 it should work. http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#4.2-mode

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.