Use SSL Certificate for connection in HAProxy
I. Environment Introduction
I was notified that the website should be changed from http to https. The current front-end architecture of my website is shown in:
Suppose we have two physical machines with many tomcat containers on each physical machine. The front end uses the http layer Load Balancing conducted by haproxy
I. Introduction to the EnvironmentTo be notified that the Web site from HTTP to use HTTPS, currently my site front-end architecture as shown:650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/7F/72/wKioL1cfFiviTO_AAAEJI0txodI055.jpg "title=" Qq20160426150836.jpg "alt=" Wkiol1cffivito_aaaeji0txodi055.jpg "/>Suppose we have two physical machines, each of which has a lot of tomcat containers on it, the front end uses the HTTP layer load balancer of hapr
Haproxy-1.5.x SSL Configuration
The haproxy-1.4 version agent is always used, and ssl configuration is not supported, the haproxy-1.5 version is supported, so the version is updated for testing. You can use the original apache ssl
Document directory
About SSL certificates
Others
Install haproxy by the way:
Some practical problems and solutions
Recently, Stunnel is used as a transparent proxy, and haproxy is used as an SSL solution. Stunnel is added between the user and the original reverse proxy, so that the user and Stunnel can use
The haproxy-1.4 version agent is always used, and SSL configuration is not supported, the haproxy-1.5 version is supported, so the version is updated for testing. You can use the original Apache SSL Certificate file for simple processing on haproyx.Originally intended to use haprox
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
There are two ways of Haproxy proxy SSL1, Haproxy itself provides SSL certificate, the back of the Web server go normal http2, Haproxy itself only provide proxy, the back of the Web server httpsThe first wayNeed to compile Haproxy support
Now online Gitlab are based on Nginx proxy gitlabsocket access to configure Nginx-based HTTPS Needless to say, configure only Haproxy-based HTTPS backend select agent Gitlab UnicornConfigurations that need to be modified are/HOME/GIT/GITLAB/CONFIG/UNICORN.RB650) this.width=650; "title=" QQ picture 20151116174300.png "Src=" http://s1.51cto.com/wyfs02/M02/76/13/ Wkiom1zjpyfrv4hoaaa4knr8cvi086.png "alt=" Wkiom1zjpyfrv4hoaaa4knr8cvi086.png "/>/home/git/gi
I like it very much;
5. HAProxy supports virtual hosts.
The following describes how to use Haproxy as the Server Load balancer:Current Environment:
Ubuntu16.04 + Haproxy 192.168.93.21Centos6 + httpd 192.168.93.5Centos6 + httpd 192.168.93.7
Haproxy configuration file
Vi/etc/haproxy
Install the haproxy and haproxy commands and the haproxy commands
Directory:1. Install haproxy2. haproxy command
1. Install haproxy
CentOS comes with haproxy, but the version may be old. You can find the latest stable version of
Rotten mud: keyword introduction of high load balancing learning haproxy, load balancing haproxy
This document consistsIlanniwebProviding friendship sponsorship, first launched in the dark world
In the previous article, we briefly explained the installation and Setup of haproxy. In this article, we will introduce the keywords used in the
forwarding. This allows you to perform protocol validation instead of blindly forwarding. For example, allow SSL but deny SSH.
L More load balancing algorithms: Now, Dynamic weighted rotation (dynamical Round Robin), weighted source address hash (weighted source hash), weighted URL hash and weighted parameter hash (weighted Parameter hash) has been implemented. Other algorithms such as weighted measured Response time will also be implemented soon.
In
Haproxy instance, which mode is Tcp,http,healthTCP mode: A full-duplex connection will be established between the client and the server, without any checks on the seven beginning, default to TCP mode, often used for applications such as SSL,SSH,SMTPHTTP mode: Client requests will be analyzed in depth before being forwarded to the backend server, and all requests incompatible with the RFC format will be rej
protocol, that is, jump to the http://haproxy.ilanni.com address. 1.4 multiple domain names on the same server Use https. The same server uses http protocol to access http.ilanni.com and haproxy.ilanni.com. 2. Configure haproxy and test the business needs. Now we can configure haproxy to meet the business needs one by one. 2.1 http jump https configuration to be honest, the https configuration of
between different domain names of the same server
All access to the http.ilanni.com domain name on the same server is directed to the https://http.ilanni.com, and access to haproxy.ilanni.com is directed to the http://haproxy.ilanni.com address.
1.4Multiple Domain names on the same server Use https
The same server uses http protocol to access http.ilanni.com and haproxy.ilanni.com.
2. Configure haproxy and test Business Requirements
Now we can config
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.