Add web-proxy role

- web-proxy role to configure nginx
- pillar with common nginx configuration

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2023-02-04 11:47:09 +01:00
parent bb252c1d47
commit 2e4d350c7f
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57
2 changed files with 26 additions and 0 deletions

21
pillar/role/web-proxy.sls Normal file
View File

@ -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 %}

5
salt/role/web-proxy.sls Normal file
View File

@ -0,0 +1,5 @@
include:
- nginx.pkg
- nginx.config
- nginx.snippets
- nginx.servers