Я имею, устанавливают Haproxy, лак и apache2 на сервере человечности и существуют несколько веб-сайт, работающий с http и https.
следующая установка настроила как указано ниже:
---443--> |
| HAProxy ------>Varnish(8081) ----------> apache2(8080)
---80---> |
haproxy.cfg
frontend http-example
bind *:80
frontend https-example
bind *:443 ssl crt /etc/letsencrypt/live/example.in/example.pem
mode http
http-request set-header X-Forwarded-Proto https
default_backend example
backend example
stick-table type binary len 32 size 30k expire 30m
acl clienthello req_ssl_hello_type 1
acl serverhello rep_ssl_hello_type 2
tcp-request inspect-delay 5s
tcp-request content accept if clienthello
tcp-response content accept if serverhello
stick on payload_lv(43,1) if clienthello
stick store-response payload_lv(43,1) if serverhello
server varnish 127.0.0.1:8081 check
План:
HAproxy: Здесь я должен настроить, если пользователь выполняется exmaple.com
и www.example.in
затем перенаправление к https://example.in
- Для https
если example1.in
затем перенаправление к www.exmaple1.in
и так далее.