summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pillar/role/web-proxy.sls21
-rw-r--r--salt/role/web-proxy.sls5
2 files changed, 26 insertions, 0 deletions
diff --git a/pillar/role/web-proxy.sls b/pillar/role/web-proxy.sls
new file mode 100644
index 0000000..5913fa6
--- /dev/null
+++ b/pillar/role/web-proxy.sls
@@ -0,0 +1,21 @@
+{%- from slspath ~ '/../map.jinja' import listen_ips -%}
+
+nginx:
+ snippets:
+ robots:
+ - location /robots.txt:
+ - root: /srv/www/htdocs
+ php-fastcgi:
+ - 'location ~* \.php$':
+ - fastcgi_index: index.php
+ - fastcgi_pass: unix:/run/php-fpm/php-fpm.sock
+ - 'include': fastcgi_params
+ - fastcgi_param: SCRIPT_FILENAME $document_root$fastcgi_script_name
+ {%- if listen_ips | length %}
+ listen:
+ {%- for ip in listen_ips %}
+ - listen: {{ ip }}:443 ssl http2
+ {%- endfor %}
+ {%- endif %}
+
+
diff --git a/salt/role/web-proxy.sls b/salt/role/web-proxy.sls
new file mode 100644
index 0000000..81f2293
--- /dev/null
+++ b/salt/role/web-proxy.sls
@@ -0,0 +1,5 @@
+include:
+ - nginx.pkg
+ - nginx.config
+ - nginx.snippets
+ - nginx.servers