Created
October 18, 2018 13:09
-
-
Save ferdinandosimonetti/b2a36b3aee5b83bb4d67bf153f28bb64 to your computer and use it in GitHub Desktop.
HAProxy reverse proxy configuration with HTTPS frontend and HTTP backend
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local2 | |
maxconn 2048 | |
tune.ssl.default-dh-param 2048 | |
defaults | |
mode http | |
log global | |
option httplog | |
option dontlognull | |
option http-server-close | |
option forwardfor except 127.0.0.0/8 | |
option redispatch | |
retries 3 | |
timeout http-request 10s | |
timeout queue 1m | |
timeout connect 10s | |
timeout client 1m | |
timeout server 1m | |
timeout http-keep-alive 10s | |
timeout check 10s | |
frontend test-fe | |
bind *:443 ssl crt /usr/local/etc/haproxy/certificate.pem | |
bind *:80 | |
http-request redirect scheme https code 301 if !{ ssl_fc } | |
default_backend test-be-http | |
backend test-be-http | |
server static web:80 check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment