updated nginx state

This commit is contained in:
Paul 2020-10-10 23:22:04 +02:00
parent 20b8969fa1
commit f3b1890de2
2 changed files with 22 additions and 4 deletions

View File

@ -31,10 +31,6 @@ nginx-config-dir-{{ subdir }}:
- service: nginx-service - service: nginx-service
{%- endfor %} {%- endfor %}
{#% for vhost in salt['file.find']( nginx.config.dir+'/sites-enabled/',type='f') %#}
{#% do salt['file.remove'](vhost) %#}
{#% endfor %#}
{%- for key, vhost in nginx.vhosts.items() %} {%- for key, vhost in nginx.vhosts.items() %}
nginx-sites-available-{{ key }}: nginx-sites-available-{{ key }}:
file.managed: file.managed:

View File

@ -0,0 +1,22 @@
## {{ salt['pillar.get']('salt_managed', default='Salt Managed') }}
server {
include http;
server_name {{ vhost_name }};
return 301 https://$server_name$request_uri;
}
server {
include https;
server_name {{ vhost_name }};
root {{ root_dir }};
index index.php index.html;
location ~ \.php?$ {
include fastcgi_params;
fastcgi_pass unix:{{ php_socket_file }};
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name;
}
}