21204: Merge branch '21204-stable-log-sort' from arvados-workbench2.git
[arvados.git] / tools / salt-install / config_examples / multi_host / aws / pillars / nginx_keepproxy_configuration.sls
1 ---
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 {%- import_yaml "ssl_key_encrypted.sls" as ssl_key_encrypted_pillar %}
7
8 ### NGINX
9 nginx:
10   ### SERVER
11   server:
12     config:
13       ### STREAMS
14       http:
15         upstream keepproxy_upstream:
16           - server: 'localhost:25107 fail_timeout=10s'
17
18   servers:
19     managed:
20       ### DEFAULT
21       arvados_keepproxy_default.conf:
22         enabled: true
23         overwrite: true
24         config:
25           - server:
26             - server_name: keep.__DOMAIN__
27             - listen:
28               - 80
29             - location /:
30               - return: '301 https://$host$request_uri'
31
32       arvados_keepproxy_ssl.conf:
33         enabled: true
34         overwrite: true
35         requires:
36           __CERT_REQUIRES__
37         config:
38           - server:
39             - server_name: keep.__DOMAIN__
40             - listen:
41               - __KEEP_EXT_SSL_PORT__ http2 ssl
42             - index: index.html index.htm
43             - location /:
44               - proxy_pass: 'http://keepproxy_upstream'
45               - proxy_read_timeout: 90
46               - proxy_connect_timeout: 90
47               - proxy_redirect: 'off'
48               - proxy_set_header: X-Forwarded-Proto https
49               - proxy_set_header: 'Host $http_host'
50               - proxy_set_header: 'X-Real-IP $remote_addr'
51               - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
52               - proxy_buffering: 'off'
53             - client_body_buffer_size: 64M
54             - client_max_body_size: 64M
55             - proxy_http_version: '1.1'
56             - proxy_request_buffering: 'off'
57             - include: snippets/ssl_hardening_default.conf
58             - ssl_certificate: __CERT_PEM__
59             - ssl_certificate_key: __CERT_KEY__
60             {%- if ssl_key_encrypted_pillar.ssl_key_encrypted.enabled %}
61             - ssl_password_file: {{ '/run/arvados/' | path_join(ssl_key_encrypted_pillar.ssl_key_encrypted.privkey_password_filename) }}
62             {%- endif %}
63             - access_log: /var/log/nginx/keepproxy.__DOMAIN__.access.log combined
64             - error_log: /var/log/nginx/keepproxy.__DOMAIN__.error.log