21832: Allows custom postgresql version config.
[arvados.git] / tools / salt-install / config_examples / multi_host / aws / pillars / nginx_prometheus_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 prometheus_upstream:
16           - server: '127.0.0.1:9090 fail_timeout=10s'
17
18   ### SITES
19   servers:
20     managed:
21       ### PROMETHEUS
22       prometheus:
23         enabled: true
24         overwrite: true
25         config:
26           - server:
27             - server_name: prometheus.__DOMAIN__
28             - listen:
29               - 80
30             - location /.well-known:
31               - root: /var/www
32             - location /:
33               - return: '301 https://$host$request_uri'
34
35       prometheus-ssl:
36         enabled: true
37         overwrite: true
38         requires:
39           __CERT_REQUIRES__
40         config:
41           - server:
42             - server_name: prometheus.__DOMAIN__
43             - listen:
44               - 443 http2 ssl
45             - index: index.html index.htm
46             - location /:
47               - proxy_pass: 'http://prometheus_upstream'
48               - proxy_read_timeout: 300
49               - proxy_connect_timeout: 90
50               - proxy_redirect: 'off'
51               - proxy_set_header: X-Forwarded-Proto https
52               - proxy_set_header: 'Host $http_host'
53               - proxy_set_header: 'X-Real-IP $remote_addr'
54               - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
55             - ssl_certificate: __CERT_PEM__
56             - ssl_certificate_key: __CERT_KEY__
57             - include: snippets/ssl_hardening_default.conf
58             {%- if ssl_key_encrypted_pillar.ssl_key_encrypted.enabled %}
59             - ssl_password_file: {{ '/run/arvados/' | path_join(ssl_key_encrypted_pillar.ssl_key_encrypted.privkey_password_filename) }}
60             {%- endif %}
61             - auth_basic: '"Restricted Area"'
62             - auth_basic_user_file: htpasswd
63             - access_log: /var/log/nginx/prometheus.__DOMAIN__.access.log combined
64             - error_log: /var/log/nginx/prometheus.__DOMAIN__.error.log