summaryrefslogtreecommitdiffstats
path: root/pillar/role/web-proxy.sls
diff options
context:
space:
mode:
authorGeorg Pfuetzenreuter2023-02-04 11:47:09 +0100
committerGeorg Pfuetzenreuter2023-02-04 11:47:09 +0100
commit2e4d350c7f2b0db4c9b21b40dbfb057509907957 (patch)
tree506f174ed06976d2bec8bf8e2ac293098c92ae84 /pillar/role/web-proxy.sls
parentbb252c1d473da7a5f5a1a5d62dfbfebb324fd299 (diff)
downloadsalt-2e4d350c7f2b0db4c9b21b40dbfb057509907957.tar.gz
salt-2e4d350c7f2b0db4c9b21b40dbfb057509907957.tar.bz2
salt-2e4d350c7f2b0db4c9b21b40dbfb057509907957.zip
Add web-proxy role
- web-proxy role to configure nginx - pillar with common nginx configuration Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
Diffstat (limited to 'pillar/role/web-proxy.sls')
-rw-r--r--pillar/role/web-proxy.sls21
1 files changed, 21 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 %}
+
+