-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathlan-haproxy.cfg
654 lines (548 loc) · 17.5 KB
/
lan-haproxy.cfg
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
# Check the HAProxy documentation for information about the configuration keywords.
# Make sure to use (compile) the latest HAProxy version from the current development branch or some features may not work!
#
# This configuration is modified from the one here: https://github.com/trick77/tunlr-style-dns-unblocking/blob/master/haproxy.conf
global
daemon
maxconn 20000
user haproxy
group haproxy
stats socket /var/run/haproxy.sock mode 0600 level admin
log /dev/log local0 debug
pidfile /var/run/haproxy.pid
spread-checks 5
defaults
maxconn 19500
log global
mode http
option httplog
option abortonclose
option http-server-close
option persist
option accept-invalid-http-response
timeout connect 20s
timeout server 120s
timeout client 120s
timeout check 10s
retries 3
listen stats # Website with useful statistics about our HAProxy frontends and backends
bind *:6969
mode http
stats enable
stats realm HAProxy
stats uri /
stats auth haproxy:changethispassword
# SNI catchall ------------------------------------------------------------------------
# We're trying to save as many IP addresses as possible that's why we're running as many backends as possible on one IP address.
# Obviously, we're using SNI on the 443 frontend only
frontend f_sni_catchall
mode http
bind 192.168.0.101:80
log global
option httplog
option accept-invalid-http-request
capture request header Host len 50
capture request header User-Agent len 150
#--- netflix
use_backend b_sni_catchall if { hdr(host) -i www.netflix.com }
use_backend b_sni_catchall if { hdr(host) -i appboot.netflix.com }
use_backend b_sni_catchall if { hdr(host) -i cbp-us.nccp.netflix.com }
use_backend b_sni_catchall if { hdr(host) -i a248.e.akamai.net }
default_backend b_sni_deadend
backend b_sni_catchall
log global
mode http
option httplog
option http-server-close
#--- netflix
use-server www.netflix.com if { hdr(host) -i www.netflix.com }
server www.netflix.com 1.2.3.4:80
use-server appboot.netflix.com if { hdr(host) -i appboot.netflix.com }
server appboot.netflix.com 1.2.3.4:80
use-server cbp-us.nccp.netflix.com if { hdr(host) -i cbp-us.nccp.netflix.com }
server cbp-us.nccp.netflix.com 1.2.3.4:80
use-server a248.e.akamai.net if { hdr(host) -i a248.e.akamai.net }
server a248.e.akamai.net 1.2.3.4:80
frontend f_sni_catchall_ssl
bind 192.168.0.101:443
mode tcp
log global
option tcplog
no option http-server-close
tcp-request inspect-delay 5s
tcp-request content accept if { req_ssl_hello_type 1 }
#--- netflix
use_backend b_sni_catchall_ssl if { req_ssl_sni -i www.netflix.com }
use_backend b_sni_catchall_ssl if { req_ssl_sni -i appboot.netflix.com }
use_backend b_sni_catchall_ssl if { req_ssl_sni -i cbp-us.nccp.netflix.com }
use_backend b_sni_catchall_ssl if { req_ssl_sni -i a248.e.akamai.net }
default_backend b_deadend_ssl
backend b_sni_catchall_ssl
log global
option tcplog
mode tcp
no option http-server-close
no option accept-invalid-http-response
#--- netflix
use-server www.netflix.com if { req_ssl_sni -i www.netflix.com }
server www.netflix.com 1.2.3.4:443
use-server appboot.netflix.com if { req_ssl_sni -i appboot.netflix.com }
server appboot.netflix.com 1.2.3.4:443
use-server cbp-us.nccp.netflix.com if { req_ssl_sni -i cbp-us.nccp.netflix.com }
server cbp-us.nccp.netflix.com 1.2.3.4:443
use-server a248.e.akamai.net if { req_ssl_sni -i a248.e.akamai.net }
server a248.e.akamai.net 1.2.3.4:443
# netflix:signup ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_signup
log global
option httplog
bind 192.168.0.102:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_signup
backend b_netflix_signup
log global
option httplog
mode http
server signup.netflix.com 1.2.3.4:8002
frontend f_netflix_signup_ssl
log global
option tcplog
bind 192.168.0.102:443
mode tcp
default_backend b_netflix_signup_ssl
backend b_netflix_signup_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server signup.netflix.com 1.2.3.4:9002
# netflix:api-global ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_api_global
log global
option httplog
bind 192.168.0.103:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_api_global
backend b_netflix_api_global
log global
option httplog
mode http
server api-global.netflix.com 1.2.3.4:8003
frontend f_netflix_api_global_ssl
log global
option tcplog
bind 192.168.0.103:443
mode tcp
default_backend b_netflix_api_global_ssl
backend b_netflix_api_global_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server api-global.netflix.com 1.2.3.4:9003
# netflix:movies ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_movies
log global
option httplog
bind 192.168.0.104:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_movies
backend b_netflix_movies
log global
option httplog
mode http
server movies.netflix.com 1.2.3.4:8004
frontend f_netflix_movies_ssl
log global
option tcplog
bind 192.168.0.104:443
mode tcp
default_backend b_netflix_movies_ssl
backend b_netflix_movies_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server movies.netflix.com 1.2.3.4:9004
# netflix:secure ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_secure
log global
option httplog
bind 192.168.0.105:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_secure
backend b_netflix_secure
log global
option httplog
mode http
server secure.netflix.com 1.2.3.4:8005
frontend f_netflix_secure_ssl
log global
option tcplog
bind 192.168.0.105:443
mode tcp
default_backend b_netflix_secure_ssl
backend b_netflix_secure_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server secure.netflix.com 1.2.3.4:9005
# netflix:moviecontrol ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_moviecontrol
log global
option httplog
bind 192.168.0.106:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_moviecontrol
backend b_netflix_moviecontrol
log global
option httplog
mode http
server moviecontrol.netflix.com 1.2.3.4:8006
frontend f_netflix_moviecontrol_ssl
log global
option tcplog
bind 192.168.0.106:443
mode tcp
default_backend b_netflix_moviecontrol_ssl
backend b_netflix_moviecontrol_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server moviecontrol.netflix.com 1.2.3.4:9006
# netflix:api ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_api
log global
option httplog
bind 192.168.0.107:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_api
backend b_netflix_api
log global
option httplog
mode http
server api.netflix.com 1.2.3.4:8007
frontend f_netflix_api_ssl
log global
option tcplog
bind 192.168.0.107:443
mode tcp
default_backend b_netflix_api_ssl
backend b_netflix_api_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server api.netflix.com 1.2.3.4:9007
# netflix:api-us ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_api_us
log global
option httplog
bind 192.168.0.108:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_api_us
backend b_netflix_api_us
log global
option httplog
mode http
server api-us.netflix.com 1.2.3.4:8008
frontend f_netflix_api_us_ssl
log global
option tcplog
bind 192.168.0.108:443
mode tcp
default_backend b_netflix_api_us_ssl
backend b_netflix_api_us_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server api-us.netflix.com 1.2.3.4:9008
# netflix:uiboot ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_uiboot
log global
option httplog
bind 192.168.0.109:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_uiboot
backend b_netflix_uiboot
log global
option httplog
mode http
server uiboot.netflix.com 1.2.3.4:8009
frontend f_netflix_uiboot_ssl
log global
option tcplog
bind 192.168.0.109:443
mode tcp
default_backend b_netflix_uiboot_ssl
backend b_netflix_uiboot_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server uiboot.netflix.com 1.2.3.4:9009
# netflix:cbp ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_cbp
log global
option httplog
bind 192.168.0.110:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_cbp
backend b_netflix_cbp
log global
option httplog
mode http
server cbp.nccp.netflix.com 1.2.3.4:8010
frontend f_netflix_cbp_ssl
log global
option tcplog
bind 192.168.0.110:443
mode tcp
default_backend b_netflix_cbp_ssl
backend b_netflix_cbp_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server cbp.nccp.netflix.com 1.2.3.4:9010
# netflix:ios ------------------------------------------------------------------------
# iOS devices use this domain.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_ios
log global
option httplog
bind 192.168.0.111:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_ios
backend b_netflix_ios
log global
option httplog
mode http
server ios.nccp.netflix.com 1.2.3.4:8011
frontend f_netflix_ios_ssl
log global
option tcplog
bind 192.168.0.111:443
mode tcp
default_backend b_netflix_ios_ssl
backend b_netflix_ios_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server ios.nccp.netflix.com 1.2.3.4:9011
# netflix:xbox ------------------------------------------------------------------------
# The Xbox 360 uses this domain and it doesn't support SNI. That's why this backend needs its own IP address.
frontend f_netflix_xbox
log global
option httplog
bind 192.168.0.112:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_xbox
backend b_netflix_xbox
log global
option httplog
mode http
server xbox.nccp.netflix.com 1.2.3.4:8012
frontend f_netflix_xbox_ssl
log global
option tcplog
bind 192.168.0.112:443
mode tcp
default_backend b_netflix_xbox_ssl
backend b_netflix_xbox_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server xbox.nccp.netflix.com 1.2.3.4:9012
# netflix:nrdp-31 ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
frontend f_netflix_nrdp-31
log global
option httplog
bind 192.168.0.113:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_nrdp-31
backend b_netflix_nrdp-31
log global
option httplog
mode http
server nccp-nrdp-31.cloud.netflix.net 1.2.3.4:8013
frontend f_netflix_nrdp-31_ssl
log global
option tcplog
bind 192.168.0.113:443
mode tcp
default_backend b_netflix_nrdp-31_ssl
backend b_netflix_nrdp-31_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server nccp-nrdp-31.cloud.netflix.net 1.2.3.4:9013
# netflix:nintendo ------------------------------------------------------------------------
# Nintendo Wii uses this domain and it doesn't support SNI. That's why this backend needs its own IP address.
frontend f_netflix_nintendo
log global
option httplog
bind 192.168.0.114:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_nintendo
backend b_netflix_nintendo
log global
option httplog
mode http
server nintendo.nccp.netflix.com 1.2.3.4:8014
frontend f_netflix_nintendo_ssl
log global
option tcplog
bind 192.168.0.114:443
mode tcp
default_backend b_netflix_nintendo_ssl
backend b_netflix_nintendo_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server nintendo.nccp.netflix.com 1.2.3.4:9014
# netflix:playstation ------------------------------------------------------------------------
# The PS3 uses this domain and it doesn't support SNI. That's why this backend needs its own IP address.
frontend f_netflix_playstation
log global
option httplog
bind 192.168.0.115:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_playstation
backend b_netflix_playstation
log global
option httplog
mode http
server playstation.nccp.netflix.com 1.2.3.4:8015
frontend f_netflix_playstation_ssl
log global
option tcplog
bind 192.168.0.115:443
mode tcp
default_backend b_netflix_playstation_ssl
backend b_netflix_playstation_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server playstation.nccp.netflix.com 1.2.3.4:9015
# netflix:nrdp ------------------------------------------------------------------------
# Some non-SNI-capable players use this domain, that's why this backend needs its own IP address.
frontend f_netflix_nrdp
log global
option httplog
bind 192.168.0.116:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_nrdp
backend b_netflix_nrdp
log global
option httplog
mode http
server nrdp.nccp.netflix.com 1.2.3.4:8016
frontend f_netflix_nrdp_ssl
log global
option tcplog
bind 192.168.0.116:443
mode tcp
default_backend b_netflix_nrdp_ssl
backend b_netflix_nrdp_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server nrdp.nccp.netflix.com 1.2.3.4:9016
# netflix:android ------------------------------------------------------------------------
# Android uses this domain but some devices don't support SNI. That's why this backend needs its own IP address.
# You could try to add it to the SNI catchall (80/443) list if you don't have enough IP addresses.
frontend f_netflix_android
log global
option httplog
bind 192.168.0.117:80
mode http
capture request header Host len 50
capture request header User-Agent len 150
default_backend b_netflix_android
backend b_netflix_android
log global
option httplog
mode http
server android.nccp.netflix.com 1.2.3.4:8017
frontend f_netflix_android_ssl
log global
option tcplog
bind 192.168.0.117:443
mode tcp
default_backend b_netflix_android_ssl
backend b_netflix_android_ssl
log global
option tcplog
no option accept-invalid-http-response
mode tcp
server android.nccp.netflix.com 1.2.3.4:9017
# deadend ------------------------------------------------------------------------
backend b_sni_deadend
mode http
log global
option httplog
backend b_deadend_ssl
mode tcp
log global
option tcplog
no option accept-invalid-http-response
no option http-server-close