21204: Merge branch '21204-stable-log-sort' from arvados-workbench2.git
[arvados.git] / tools / salt-install / config_examples / multi_host / aws / pillars / nginx_download_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   servers:
11     managed:
12       ### DEFAULT
13       arvados_download_default.conf:
14         enabled: true
15         overwrite: true
16         config:
17           - server:
18             - server_name: download.__DOMAIN__
19             - listen:
20               - 80
21             - location /:
22               - return: '301 https://$host$request_uri'
23
24       ### DOWNLOAD
25       arvados_download_ssl.conf:
26         enabled: true
27         overwrite: true
28         requires:
29           __CERT_REQUIRES__
30         config:
31           - server:
32             - server_name: download.__DOMAIN__
33             - listen:
34               - __KEEPWEB_EXT_SSL_PORT__ http2 ssl
35             - index: index.html index.htm
36             - location /:
37               - proxy_pass: 'http://collections_downloads_upstream'
38               - proxy_read_timeout: 90
39               - proxy_connect_timeout: 90
40               - proxy_redirect: 'off'
41               - proxy_set_header: X-Forwarded-Proto https
42               - proxy_set_header: 'Host $http_host'
43               - proxy_set_header: 'X-Real-IP $remote_addr'
44               - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
45               - proxy_buffering: 'off'
46             - client_max_body_size: 0
47             - proxy_http_version: '1.1'
48             - proxy_request_buffering: 'off'
49             - include: snippets/ssl_hardening_default.conf
50             - ssl_certificate: __CERT_PEM__
51             - ssl_certificate_key: __CERT_KEY__
52             {%- if ssl_key_encrypted_pillar.ssl_key_encrypted.enabled %}
53             - ssl_password_file: {{ '/run/arvados/' | path_join(ssl_key_encrypted_pillar.ssl_key_encrypted.privkey_password_filename) }}
54             {%- endif %}
55             - access_log: /var/log/nginx/download.__DOMAIN__.access.log combined
56             - error_log: /var/log/nginx/download.__DOMAIN__.error.log