Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2021
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 1.40 KB | None | 0 0
  1. global
  2.     daemon
  3.     maxconn 50000
  4.     user haproxy
  5.     group haproxy
  6.     log 127.0.0.1:514 local0 notice
  7.     stats socket /var/run/haproxy.sock expose-fd listeners
  8.  
  9. defaults
  10.     log global
  11.     mode http
  12.     option httplog
  13.     option dontlognull
  14.     timeout connect 5s
  15.     timeout check 5s
  16.     timeout client 30s
  17.     timeout server 30s
  18.     timeout http-keep-alive 60s
  19.     option http-keep-alive
  20.  
  21. frontend stats
  22.     bind <%= scope.function_interface_by_tag(['public', 'address']) %>:8999
  23.     bind *:8999
  24.     mode http
  25.     stats enable
  26.     stats uri /
  27.  
  28. frontend test
  29.     bind *:9022 ssl crt /etc/ssl/private/haproxy.pem alpn h2,http/1.1
  30.     mode http
  31.    
  32.     stick-table type string size 10k store gpc0
  33.     http-request set-var(sess.src_port) src_port
  34.     http-request set-var(sess.source) src,concat(:,sess.src_port)
  35.     http-request track-sc0 var(sess.source)
  36.     http-request sc-inc-gpc0
  37.    
  38.     acl exceeded_connection sc0_get_gpc0 ge 10000
  39.     acl reset sc0_clr_gpc0 ge 0
  40.    
  41.     http-response set-header Connection close if exceeded_connection reset
  42.    
  43.     acl is_authorized hdr(Authorization) "something"
  44.     http-request deny if !is_authorized
  45.    
  46.     default_backend test
  47.  
  48. backend test
  49.     balance roundrobin
  50.     http-reuse always
  51.     mode http
  52.     option tcp-check
  53.     option srvtcpka
  54.     srvtcpka-intvl 60s
  55.     srvtcpka-cnt 3
  56.     http-response del-header Connection
  57.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement