Haproxy SSL Configuration

Source: Internet
Author: User
Tags ssl certificate haproxy
There are two methods for haproxy proxy SSL

1. haproxy itself provides an SSL certificate, and the subsequent web server follows the normal HTTP

2. haproxy itself only provides proxy, followed by the Web server https

Method 1

You need to compile haproxy to support SSL. Compile parameters:

make TARGET=linux26 USE_OPENSSL=1 ADDLIB=-lzldd haproxy | grep ssllibssl.so.10 => /usr/lib64/libssl.so.10 (0x00007fb0485e5000)

Configuration parameters:

Frontend https_frontend bind *: 443 ssl crt/etc/SSL/certs/servername. PEM mode HTTP option httpclose option forwardfor reqadd X-forwarded-Proto: \ HTTPS secure web_serverbackend web_server mode HTTP balance roundrobin cookie serverid insert indirect nocache server S1 192.168.250.47: 80 check cookie S1 server S2 192.168.250.49: 80 check cookie S2 Note: The PEM file is merged into the following two files: CAT servername. CRT servername. key | tee servername. PEM

Method 2

It is simple and convenient to recompile and support SSL. You only need to configure SSL for the Web server.

Frontend https_frontend bind *: 443 mode TCP default_backend web_serverbackend web_server mode TCP balance roundrobin stick-Table type IP size 200 K expire 30 m stick on SRC server S1 192.168.250.47: 443 server S2 192.168.250.49: 443 note: In this mode, the mode must be TCP.

Refer:

Http://virtuallyhyper.com/2013/05/configure-haproxy-to-load-balance-sites-with-ssl/

Http://www.rackspace.com/knowledge_center/article/setting-up-haproxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.