Haproxy does not support proxying different sites (using virtual hosts)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
haproxy (Juju Charms Collection) |
New
|
Undecided
|
Unassigned |
Bug Description
I have tried reusing one haproxy instance for serving different services with different virtual hosts (same IP address, all on port 80).
What I have tried:
* Using bind:
haproxy-jenkins:
services: |
- service_name: node-app_service
- service_name: node-app2_service
does not work (gives "cannot bind socket") because the IP behind the hostname is not bound to the machine.
* Using reqiallow:
haproxy-jenkins:
services: |
- service_name: node-app_service
- service_name: node-app2_service
also does not work, since all entries must be set to "0.0.0.0" (same as with bind) and the second fail to bind to that address.
* Use different IP addresses
At least with Amazon EC2 this seems hard, as only local addresses are exposed to the machines, and it is not possible to attach multiple IPs except with in virtual private cloud: http://
The proper solution is probably to use frontend and backends with ACL:
http://
but it is possible to do with the current configuration options.
WORKAROUND:
17:37 < sidnei> mariusko: im using haproxy to proxy different sites, the difference is that we're using apache in front of haproxy (for ssl termination)
and apache forwards to haproxy on a specific port
17:37 < sidnei> mariusko: i understand that your use case is different and you want haproxy on port 80 proxying to multiple backends
17:40 < mariusko> sidnei: using vhost templates?
17:40 < sidnei> mariusko: yup
Related branches
- Matthias Cramer: Pending requested
-
Diff: 806 lines (+606/-87) (has conflicts)4 files modifiedREADME.md (+119/-0)
hooks/hooks.py (+220/-87)
hooks/test_hooks.py (+263/-0)
revision (+4/-0)
description: | updated |
description: | updated |
tags: | added: openstack |
tags: | removed: openstack |