Skip to content

Commit

Permalink
mediawiki: hash based on header for jobrunner haproxy config (#4187)
Browse files Browse the repository at this point in the history
  • Loading branch information
paladox authored Feb 13, 2025
1 parent 2eb4649 commit 44a7acd
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions modules/role/templates/jobrunner_haproxy/lb.cfg.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,67 @@ listen jobrunner
http-check expect status 405
http-reuse always
mode http

bind :9007
bind :::9007
balance roundrobin

balance hdr(X-Request-ID)
hash-type consistent

<%- @backends.each_pair do | name, property | -%>
<%- if property['depool'] != true-%>
server <%= name %> <%= property['ip'] %>:<%= property['port'] %> ssl verify none check
<%- end -%>
<%- end -%>

http-request set-header Host jobrunner.wikitide.net

# Preserve the X-Request-ID header
http-request set-header X-Request-ID %[req.hdr(X-Request-ID)]

listen jobrunner_high
option httpchk
http-check send meth GET uri /rpc/RunSingleJob.php
http-check expect status 405
http-reuse always
mode http

bind :9008
bind :::9008
balance roundrobin

balance hdr(X-Request-ID)
hash-type consistent

<%- @backends.each_pair do | name, property | -%>
<%- if property['depool'] != true -%>
server <%= name %> <%= property['ip'] %>:<%= property['port'] %> ssl verify none check
<%- end -%>
<%- end -%>

http-request set-header Host jobrunner-high.wikitide.net

# Preserve the X-Request-ID header
http-request set-header X-Request-ID %[req.hdr(X-Request-ID)]

listen videoscaler
option httpchk
http-check send meth GET uri /rpc/RunSingleJob.php
http-check expect status 405
http-reuse always
mode http

bind :9009
bind :::9009
balance roundrobin

balance hdr(X-Request-ID)
hash-type consistent

<%- @backends.each_pair do | name, property | -%>
<%- if property['depool'] != true -%>
server <%= name %> <%= property['ip'] %>:<%= property['port'] %> ssl verify none check
<%- end -%>
<%- end -%>
http-request set-header Host videoscaler.wikitide.net

# Preserve the X-Request-ID header
http-request set-header X-Request-ID %[req.hdr(X-Request-ID)]

0 comments on commit 44a7acd

Please sign in to comment.