File size: 1,796 Bytes
542878f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
global
    daemon
    maxconn 1024
    log /dev/log local0
    log /dev/log local1 notice
    stats timeout 30s

    ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS

defaults
    log global
    mode http
    option httplog
    option dontlognull
    retries 3
    option redispatch
    timeout http-request 10s
    timeout queue 10s
    timeout connect 10s
    timeout client 10s
    timeout server 10s
    timeout check 10s

frontend http_front
    bind *:80
    bind :::80
    mode http

    stick-table type ip size 100k expire 30s store http_req_rate(10s)
    http-request track-sc0 src
    http-request deny deny_status 429 if { sc_http_req_rate(0) gt 100 }

    acl is_websocket hdr(Upgrade) -i websocket
    acl is_websocket hdr_beg(Host) -i ws

    use_backend websocket_chatting_back if is_websocket
    default_backend websocket_chatting_back

frontend https_front
    bind *:443 ssl crt F:\command\haproxy\certificates.pem
    bind :::443 ssl crt F:\command\haproxy\certificates.pem
    mode http

    acl is_websocket hdr(Upgrade) -i websocket
    acl is_websocket hdr_beg(Host) -i ws

    stick-table type ip size 100k expire 30s store http_req_rate(10s)
    http-request track-sc0 src
    http-request deny deny_status 429 if { sc_http_req_rate(0) gt 100 }

    use_backend websocket_chatting_back if is_websocket
    default_backend websocket_chatting_back

backend websocket_chatting_back
    mode http
    timeout queue 10s
    balance roundrobin
    option forwardfor
    http-request set-header X-Forwarded-Port %[dst_port]
    http-request add-header X-Forwarded-Proto https if { ssl_fc }
    server websocket_svc_1 qywok-cryptocurrency-prediction.hf.space:443/crypto/lists ssl verify required check