8a4001e9eab2d96bfb5eb0e14653c112c825ca84
[aai/test-config.git] / haproxy / haproxy.cfg
1 global
2         log /dev/log    local0
3         stats socket /usr/local/etc/haproxy/haproxy.socket mode 660 level admin
4         stats timeout 30s
5         user root
6         group root
7         daemon
8         #################################
9         # Default SSL material locations#
10         #################################
11         ca-base /etc/ssl/certs
12         crt-base /etc/ssl/private
13
14         # Default ciphers to use on SSL-enabled listening sockets.
15         # For more information, see ciphers(1SSL). This list is from:
16         # https://hynek.me/articles/hardening-your-web-servers-ssl-ciphers/
17         # An alternative list with additional directives can be obtained from
18         # https://mozilla.github.io/server-side-tls/ssl-config-generator/?server=haproxy
19         tune.ssl.default-dh-param 2048
20         ssl-default-bind-options force-tlsv12 no-tls-tickets
21         ssl-default-bind-ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
22         tune.ssl.maxrecord 1400
23
24 defaults
25         log     global
26         mode    http
27         option  httplog
28 #       option  dontlognull
29 #       errorfile 400 /etc/haproxy/errors/400.http
30 #       errorfile 403 /etc/haproxy/errors/403.http
31 #       errorfile 408 /etc/haproxy/errors/408.http
32 #       errorfile 500 /etc/haproxy/errors/500.http
33 #       errorfile 502 /etc/haproxy/errors/502.http
34 #       errorfile 503 /etc/haproxy/errors/503.http
35 #       errorfile 504 /etc/haproxy/errors/504.http
36
37         option  http-server-close
38         option forwardfor except 127.0.0.1
39         retries 6
40         option redispatch
41         maxconn 50000
42         timeout connect 50000
43         timeout client  480000
44         timeout server  480000
45         timeout http-keep-alive 30000
46
47
48 frontend IST_8443
49         mode http
50         bind 0.0.0.0:8443 name https ssl crt /etc/ssl/private/aai.pem
51 #       log-format %ci:%cp\ [%t]\ %ft\ %b/%s\ %Tq/%Tw/%Tc/%Tr/%Tt\ %ST\ %B\ %CC\ %CS\ %tsc\ %ac/%fc/%bc/%sc/%rc\ %sq/%bq\ %hr\ %hs\ {%[ssl_c_verify],%{+Q}[ssl_c_s_dn],%{+Q}[ssl_c_i_dn]}\ %{+Q}r
52         log-format "%ci:%cp [%tr] %ft %b/%s %TR/%Tw/%Tc/%Tr/%Ta %ST %B %CC \ %CS %tsc %ac/%fc/%bc/%sc/%rc %sq/%bq %hr %hs %{+Q}r"
53         option httplog
54         log global
55         option logasap
56         option forwardfor
57         capture request header  Host len 100
58         capture response header Host len 100
59         option log-separate-errors
60         option forwardfor
61         http-request set-header X-Forwarded-Proto https if { ssl_fc }
62         http-request set-header X-AAI-Client-SSL TRUE if { ssl_c_used }
63         http-request set-header X-AAI-SSL                       %[ssl_fc]
64         http-request set-header X-AAI-SSL-Client-Verify         %[ssl_c_verify]
65         http-request set-header X-AAI-SSL-Client-DN             %{+Q}[ssl_c_s_dn]
66         http-request set-header X-AAI-SSL-Client-CN             %{+Q}[ssl_c_s_dn(cn)]
67         http-request set-header X-AAI-SSL-Issuer                %{+Q}[ssl_c_i_dn]
68         http-request set-header X-AAI-SSL-Client-NotBefore      %{+Q}[ssl_c_notbefore]
69         http-request set-header X-AAI-SSL-Client-NotAfter       %{+Q}[ssl_c_notafter]
70         http-request set-header X-AAI-SSL-ClientCert-Base64   %{+Q}[ssl_c_der,base64]
71         http-request set-header X-AAI-SSL-Client-OU             %{+Q}[ssl_c_s_dn(OU)]
72         http-request set-header X-AAI-SSL-Client-L              %{+Q}[ssl_c_s_dn(L)]
73         http-request set-header X-AAI-SSL-Client-ST             %{+Q}[ssl_c_s_dn(ST)]
74         http-request set-header X-AAI-SSL-Client-C              %{+Q}[ssl_c_s_dn(C)]
75         http-request set-header X-AAI-SSL-Client-O              %{+Q}[ssl_c_s_dn(O)]
76         reqadd X-Forwarded-Proto:\ https
77         reqadd X-Forwarded-Port:\ 8443
78
79 #######################
80 #ACLS FOR PORT 8446####
81 #######################
82
83         acl is_Port_8446_generic path_reg -i ^/aai/v[0-9]+/search/generic-query$
84         acl is_Port_8446_nodes path_reg -i ^/aai/v[0-9]+/search/nodes-query$
85         acl is_Port_8446_version path_reg -i ^/aai/v[0-9]+/query$
86         acl is_named-query path_beg -i /aai/search/named-query
87         acl is_search-model path_beg -i /aai/search/model
88         use_backend IST_AAI_8446 if is_Port_8446_generic or is_Port_8446_nodes or is_Port_8446_version or is_named-query or is_search-model
89
90         default_backend IST_Default_8447
91
92
93 #######################
94 #DEFAULT BACKEND 847###
95 #######################
96
97 backend IST_Default_8447
98         balance roundrobin
99         http-request set-header X-Forwarded-Port %[src_port]
100         http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
101         server aai-resources.api.simpledemo.onap.org  aai-resources.api.simpledemo.onap.org:8447  port 8447 ssl verify none
102
103 #######################
104 # BACKEND 8446#########
105 #######################
106
107 backend IST_AAI_8446
108         balance roundrobin
109         http-request set-header X-Forwarded-Port %[src_port]
110         http-response set-header Strict-Transport-Security max-age=16000000;\ includeSubDomains;\ preload;
111         server aai-traversal.api.simpledemo.onap.org aai-traversal.api.simpledemo.onap.org:8446  port 8446 ssl verify none
112
113 listen IST_AAI_STATS
114         mode http
115         bind *:8080
116         stats uri /stats
117         stats enable
118         stats refresh 30s
119         stats hide-version
120         stats auth admin:admin
121         stats show-legends
122         stats show-desc IST AAI APPLICATION NODES
123         stats admin if TRUE