feat(distro): add centos-7 support
[arvados-formula.git] / test / salt / pillar / examples / nginx_workbench2_configuration.sls
index 9718a9665964a4fbe89eaae29cc52850ea695720..c63364909b8e67d49af12190bcb94cf2026d8aae 100644 (file)
@@ -1,10 +1,14 @@
 ---
-{% set nginx_log = '/var/log/nginx' %}
+{%- if grains.os_family in ('RedHat',) %}
+  {%- set group = 'nginx' %}
+{%- else %}
+  {%- set group = 'www-data' %}
+{%- endif %}
 
 ### ARVADOS
 arvados:
   config:
-    group: www-data
+    group: {{ group }}
 
 ### NGINX
 nginx:
@@ -12,12 +16,12 @@ nginx:
   servers:
     managed:
       ### DEFAULT
-      arvados_workbench2_default:
+      arvados_workbench2_default.conf:
         enabled: true
         overwrite: true
         config:
           - server:
-            - server_name: workbench2.example.net
+            - server_name: workbench2.fixme.example.net
             - listen:
               - 80
             - location /.well-known:
@@ -25,12 +29,12 @@ nginx:
             - location /:
               - return: '301 https://$host$request_uri'
 
-      arvados_workbench2:
+      arvados_workbench2_ssl.conf:
         enabled: true
         overwrite: true
         config:
           - server:
-            - server_name: workbench2.example.net
+            - server_name: workbench2.fixme.example.net
             - listen:
               - 443 http2 ssl
             - index: index.html index.htm
@@ -39,7 +43,10 @@ nginx:
               - try_files: '$uri $uri/ /index.html'
               - 'if (-f $document_root/maintenance.html)':
                 - return: 503
+            - location /config.json:
+              - return: {{ "200 '" ~ '{"API_HOST":"fixme.example.net"}' ~ "'" }}
+            - include: 'snippets/ssl_hardening_default.conf'
             # - include: 'snippets/letsencrypt.conf'
-            - include: 'snippets/snakeoil.conf'
-            - access_log: {{ nginx_log }}/workbench2.example.net.access.log combined
-            - error_log: {{ nginx_log }}/workbench2.example.net.error.log
+            - include: 'snippets/ssl_snakeoil.conf'
+            - access_log: /var/log/nginx/workbench2.fixme.example.net.access.log combined
+            - error_log: /var/log/nginx/workbench2.fixme.example.net.error.log