feat(provision): refactor to add other setup examples
[arvados.git] / tools / salt-install / config_examples / single_host / single_hostname / pillars / nginx_webshell_configuration.sls
1 ---
2 # Copyright (C) The Arvados Authors. All rights reserved.
3 #
4 # SPDX-License-Identifier: AGPL-3.0
5
6 ### NGINX
7 nginx:
8   ### SERVER
9   server:
10     config:
11
12       ### STREAMS
13       http:
14         upstream webshell_upstream:
15           - server: '__HOSTNAME_INT__:4200 fail_timeout=10s'
16
17   ### SITES
18   servers:
19     managed:
20       arvados_webshell_ssl:
21         enabled: true
22         overwrite: true
23         config:
24           - server:
25             - server_name: __HOSTNAME__EXT__
26             - listen:
27               - __WEBSHELL_EXT_SSL_PORT__ http2 ssl
28             - index: index.html index.htm
29             - location /__HOSTNAME__:
30               - proxy_pass: 'http://webshell_upstream'
31               - proxy_read_timeout: 90
32               - proxy_connect_timeout: 90
33               - proxy_set_header: 'Host $http_host'
34               - proxy_set_header: 'X-Real-IP $remote_addr'
35               - proxy_set_header: X-Forwarded-Proto https
36               - proxy_set_header: 'X-Forwarded-For $proxy_add_x_forwarded_for'
37               - proxy_ssl_session_reuse: 'off'
38
39               - "if ($request_method = 'OPTIONS')":
40                 - add_header: "'Access-Control-Allow-Origin' '*'"
41                 - add_header: "'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'"
42                 - add_header: "'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'"
43                 - add_header: "'Access-Control-Max-Age' 1728000"
44                 - add_header: "'Content-Type' 'text/plain charset=UTF-8'"
45                 - add_header: "'Content-Length' 0"
46                 - return: 204
47
48               - "if ($request_method = 'POST')":
49                 - add_header: "'Access-Control-Allow-Origin' '*'"
50                 - add_header: "'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'"
51                 - add_header: "'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'"
52
53               - "if ($request_method = 'GET')":
54                 - add_header: "'Access-Control-Allow-Origin' '*'"
55                 - add_header: "'Access-Control-Allow-Methods' 'GET, POST, OPTIONS'"
56                 - add_header: "'Access-Control-Allow-Headers' 'DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type'"
57
58             - include: 'snippets/arvados-snakeoil.conf'
59             - access_log: /var/log/nginx/webshell.__CLUSTER__.__DOMAIN__.access.log combined
60             - error_log: /var/log/nginx/webshell.__CLUSTER__.__DOMAIN__.error.log
61