2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: AGPL-3.0
6 {%- import_yaml "ssl_key_encrypted.sls" as ssl_key_encrypted_pillar %}
7 {%- set balanced_controller = ("__ENABLE_BALANCER__"|to_bool) %}
8 {%- set server_name = grains['fqdn'] if balanced_controller else "__DOMAIN__" %}
17 'geo $external_client':
20 '__CLUSTER_INT_CIDR__': 0
21 upstream controller_upstream:
22 - server: 'localhost:8003 fail_timeout=10s'
28 arvados_controller_default.conf:
33 - server_name: {{ server_name }}
36 - location /.well-known:
38 {%- if balanced_controller %}
39 {%- set balancer_ip = salt['cmd.run']("getent hosts __BALANCER_NODENAME__ | awk '{print $1 ; exit}'", python_shell=True) %}
40 {%- set prometheus_ip = salt['cmd.run']("getent hosts __PROMETHEUS_NODENAME__ | awk '{print $1 ; exit}'", python_shell=True) %}
41 - index: index.html index.htm
43 - allow: {{ balancer_ip }}
44 - allow: {{ prometheus_ip }}
46 - proxy_pass: 'http://controller_upstream'
47 - proxy_read_timeout: 300
48 - proxy_connect_timeout: 90
49 - proxy_redirect: 'off'
50 - proxy_max_temp_file_size: 0
51 - proxy_request_buffering: 'off'
52 - proxy_buffering: 'off'
53 - proxy_http_version: '1.1'
54 - access_log: /var/log/nginx/{{ server_name }}.access.log combined
55 - error_log: /var/log/nginx/{{ server_name }}.error.log
56 - client_max_body_size: 128m
59 - return: '301 https://$host$request_uri'
62 {%- if not balanced_controller %}
63 arvados_controller_ssl.conf:
70 - server_name: {{ server_name }}
72 - __CONTROLLER_EXT_SSL_PORT__ http2 ssl
73 - index: index.html index.htm
75 - proxy_pass: 'http://controller_upstream'
76 - proxy_read_timeout: 300
77 - proxy_connect_timeout: 90
78 - proxy_redirect: 'off'
79 - proxy_set_header: X-Forwarded-Proto https
80 - proxy_set_header: 'Host $http_host'
81 - proxy_set_header: 'X-Real-IP $remote_addr'
82 - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
83 - proxy_set_header: 'X-External-Client $external_client'
84 - proxy_set_header: 'Upgrade $http_upgrade'
85 - proxy_set_header: 'Connection "upgrade"'
86 - proxy_max_temp_file_size: 0
87 - proxy_request_buffering: 'off'
88 - proxy_buffering: 'off'
89 - proxy_http_version: '1.1'
90 - include: snippets/ssl_hardening_default.conf
91 - ssl_certificate: __CERT_PEM__
92 - ssl_certificate_key: __CERT_KEY__
93 {%- if ssl_key_encrypted_pillar.ssl_key_encrypted.enabled %}
94 - ssl_password_file: {{ '/run/arvados/' | path_join(ssl_key_encrypted_pillar.ssl_key_encrypted.privkey_password_filename) }}
96 - access_log: /var/log/nginx/{{ server_name }}.access.log combined
97 - error_log: /var/log/nginx/{{ server_name }}.error.log
98 - client_max_body_size: 128m