paulbsd-salt/states/nginx/vhost.j2

34 lines
660 B
Plaintext
Raw Normal View History

2020-07-10 00:58:55 +02:00
## {{ 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 }};
{%- if not proxy %}
root {{ root_dir }};
{%- endif %}
location / {
{%- if proxy %}
proxy_pass {{ proxy_pass }};
{%- if not cache %}
proxy_no_cache 1;
proxy_cache_bypass 1;
{%- endif %}
{%- endif %}
{%- if autoindex %}
autoindex on;
autoindex_localtime on;
{%- endif %}
}
{%- for dir in dirs %}
location {{ dir.name }} {
alias {{ dir.alias }};
}
{%- endfor %}
}