diff --git a/states/nginx/config.sls b/states/nginx/config.sls index 22211a1..299bd0e 100644 --- a/states/nginx/config.sls +++ b/states/nginx/config.sls @@ -31,10 +31,6 @@ nginx-config-dir-{{ subdir }}: - service: nginx-service {%- 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() %} nginx-sites-available-{{ key }}: file.managed: diff --git a/states/nginx/templates/types/zabbix.j2 b/states/nginx/templates/types/zabbix.j2 new file mode 100644 index 0000000..b7a12a1 --- /dev/null +++ b/states/nginx/templates/types/zabbix.j2 @@ -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; + } +}