defaults log global option httplog mode http timeout connect 5000ms timeout client 50000ms timeout server 50000ms timeout tunnel 120s listen http1 # this address must be 127.0.0.1 instead of * for accept-proxy! # Also, do not put these args on the listen line above (that doesn't work either)! bind 127.0.0.1:$accept_proxy_port accept-proxy $insecure_testing_bind mode http log global timeout client 120s option forwardfor option http-server-close # replace "/policies/" with "/static/policies/" at the beginning of any request path. reqrep ^([^\ :]*)\ /policies/(.*) \1\ /static/policies/\2 acl is_static path_beg $base_url/static use_backend static if is_static acl is_hub path_beg $base_url/hub acl is_hub path_beg $base_url/cookies acl is_hub path_beg $base_url/blobs acl is_hub path_beg $base_url/invoice acl is_hub path_beg $base_url/upload acl is_hub path_beg $base_url/alive acl is_hub path_beg $base_url/auth acl is_hub path_beg $base_url/stats acl is_hub path_beg $base_url/registration acl is_hub path_beg $base_url/projects acl is_hub path_beg $base_url/help acl is_hub path_beg $base_url/settings use_backend hub if is_hub acl is_proxy path_reg ^$base_url/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/port use_backend proxy if is_proxy # todo: we could combine this and the above regexp, since both use proxy backend. acl is_raw path_reg ^$base_url/[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}/raw use_backend proxy if is_raw default_backend static backend static balance roundrobin timeout server 45s $nginx_servers #server server1 127.0.0.1:8080 maxconn 1024 backend hub #balance source #balance roundrobin balance leastconn cookie SMCSERVERID3$base_url insert nocache option httpclose option forwardfor timeout server 60s option httpchk $base_url/alive $hub_servers #server hub1 127.0.0.1:5000 check #server hub2 127.0.0.1:5001 check #server hub3 127.0.0.1:5002 check backend proxy #balance roundrobin balance leastconn cookie SMCSERVERID2$base_url insert nocache option httpclose option forwardfor timeout server 60s $proxy_servers #server hub0 10.2.2.3:5001 cookie server10.2.2.3 check maxconn 10000 $insecure_redirect # unsecured -- binds to port 80 and redirect to secure site #frontend unsecured *:80 # redirect location https://...