devops-coop / ansible-haproxy

Installs and configure HAProxy
Apache License 2.0
96 stars 97 forks source link

Add ability to use redirect on backends #5

Closed scottrobertson closed 9 years ago

scottrobertson commented 9 years ago

This one is quite urgent as it is blocking a deployment. If you could look into it asap that would be awesome.

rafecolton commented 9 years ago

LGTM

PierrePaul commented 9 years ago

If I understand correctly, only one redirect clause is supported with this template? And only supported in backends?

scottrobertson commented 9 years ago

I merged this into my own fork so i could use it, and it came out as:

backend appservers
    description App Servers
    server app0.lon1.example.com:80
    redirect scheme https if !{ ssl_fc }

Works perfectly for me.

PierrePaul commented 9 years ago

I'm closing this. See commit ea2190f41db15bb67ec564d776fe59e76b0b0453 . I added the redirect options. The synthax is slightly different to yours. Commit ea2190f41db15bb67ec564d776fe59e76b0b0453 lets you specify multiple redirect clauses as per haproxy documentation.