b6a217463e94382dabb5fdf676092a6285c7de98
[arvados-formula.git] / test / salt / pillar / examples / nginx_websocket_configuration.sls
1 ---
2 {% set nginx_log = '/var/log/nginx' %}
3
4 ### NGINX
5 nginx:
6   ### SERVER
7   server:
8     config:
9       ### STREAMS
10       http:
11         upstream websocket_upstream:
12           - server: '127.0.0.1:8005 fail_timeout=10s'
13
14   servers:
15     managed:
16       ### DEFAULT
17       arvados_ws_default:
18         enabled: true
19         overwrite: true
20         config:
21           - server:
22             - server_name: ws.example.net
23             - listen:
24               - 80
25             - location /.well-known:
26               - root: /var/www
27             - location /:
28               - return: '301 https://$host$request_uri'
29
30       arvados_websocket:
31         enabled: true
32         overwrite: true
33         config:
34           - server:
35             - server_name: ws.example.net
36             - listen:
37               - 443 http2 ssl
38             - index: index.html index.htm
39             - location /:
40               - proxy_pass: 'http://websocket_upstream'
41               - proxy_read_timeout: 600
42               - proxy_connect_timeout: 90
43               - proxy_redirect: 'off'
44               - proxy_set_header: 'Host $host'
45               - proxy_set_header: 'X-Real-IP $remote_addr'
46               - proxy_set_header: 'Upgrade $http_upgrade'
47               - proxy_set_header: 'Connection "upgrade"'
48               - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
49               - proxy_buffering: 'off'
50             - client_body_buffer_size: 64M
51             - client_max_body_size: 64M
52             - proxy_http_version: '1.1'
53             - proxy_request_buffering: 'off'
54             # - include: 'snippets/letsencrypt.conf'
55             - include: 'snippets/snakeoil.conf'
56             - access_log: {{ nginx_log }}/ws.example.net.access.log combined
57             - error_log: {{ nginx_log }}/ws.example.net.error.log