Created
May 25, 2015 11:49
-
-
Save xelwarto/ac4f8b43e4194355082c to your computer and use it in GitHub Desktop.
Jenkins CI haproxy configuration example
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 | |
chroot /var/lib/haproxy | |
crt-base /etc/pki/tls/certs | |
daemon | |
group haproxy | |
log 127.0.0.1 local0 | |
maxconn 2000 | |
pidfile /var/run/haproxy.pid | |
stats socket /var/lib/haproxy/stats | |
tune.ssl.default-dh-param 2048 | |
user haproxy | |
defaults | |
log global | |
maxconn 2000 | |
mode http | |
option redispatch | |
option forwardfor | |
option http-server-close | |
retries 3 | |
timeout http-request 10s | |
timeout queue 1m | |
timeout connect 10s | |
timeout client 1m | |
timeout server 1m | |
timeout check 10s | |
frontend jenkins | |
bind *:443 no-sslv3 ssl crt jenkins-ci.cert | |
bind *:80 | |
default_backend jenkins-mstr | |
redirect location https://jenkins.my.domain/ if !{ ssl_fc } | |
reqadd X-Forwarded-Proto:\ http | |
backend jenkins-mstr | |
balance roundrobin | |
http-request set-header Host 127.0.0.1:8080 | |
reqirep ^([^\ \t:]*:)\ https://jenkins.my.domain/(.*) \1\ http://127.0.0.1:8080/\2 | |
rspirep ^([^\ \t:]*:)\ http://127.0.0.1:8080/(.*) \1\ https://jenkins.my.domain/\2 | |
server jenkins01 127.0.0.1:8080 check |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oh I found it. Here is the proper backend configuration for the frontend configuration I posted above: