Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-23-2016, 01:04 PM   #1
LQ Newbie
Registered: Jun 2016
Posts: 3

Rep: Reputation: Disabled
Redirect - haporxy

Does anyone know how to do a redirect configuration haproxy to specific sub page, for example.

I tried different redirect, but it does not work, eg .:

redirect location https://example.coml code 301 if { hdr_beg(host) -i contact } !{ ssl_fc }
acl is_example_contact_https hdr_beg(host)  -i
acl url_cont url_beg /contact
use_backend bk-example_contact_https if  is_example_contact_https url_cont

backend bk-example_contact_https
    balance roundrobin
    cookie serv insert indirect nocache
    option forwardfor
    option httpclose
    default-server inter 1s
    server contact1

Last edited by brandon65; 06-24-2016 at 02:42 AM.
Old 06-24-2016, 06:25 AM   #2
Senior Member
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,250

Rep: Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423Reputation: 1423
To be brutally honest, you should be doing these at the backend servers rather that at the haproxy server level. Keep haproxy for balancing and directing traffic.

Edit: This comes from recent experience trying to troubleshoot an issue that should have been in the vhosts file (or .htaccess) and then eventually finding out that it was being done by haproxy.

Last edited by TenTenths; 06-24-2016 at 06:28 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why am I not able to redirect using htaccess. It says too many redirect rules. swathi.akkineni Linux - Newbie 1 07-31-2015 04:20 PM
Nginx, Horde, Https, Redirect, This webpage has a redirect loop axetone Ubuntu 0 02-08-2015 11:44 PM
redirect IP's ?? snoply Linux - Networking 1 03-26-2006 05:07 AM
redirect matt1982 Programming 2 12-20-2004 10:53 AM
Redirect sheek Programming 1 07-25-2003 01:53 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration