wmdeit-cf-wmdelib/templates/nginx-vhost.conf.mustache

68 lines
1.8 KiB
Plaintext
Raw Normal View History

2024-02-20 17:10:12 +00:00
#
# Managed by CFEengine
#
{{^vars.nginx_vhost.site.ssl}}
server {
listen *:80;
server_name {{vars.nginx_vhost.site.domain}} {{#vars.nginx_vhost.site.aliases}}{{.}} {{/vars.nginx_vhost.site.aliases}};
root {{vars.nginx_vhost.site.doc_root}};
location ^~ /.well-known/acme-challenge/ {
alias {{vars.nginx.default_html_dir}}/.well-known/acme-challenge/;
try_files $uri $uri/ =404;
}
2024-02-21 14:55:00 +00:00
{{{vars.nginx_vhost.site.raw}}}
2024-02-20 17:10:12 +00:00
}
{{/vars.nginx_vhost.site.ssl}}
{{#vars.nginx_vhost.site.ssl}}
server {
listen *:80;
server_name {{vars.nginx_vhost.site.domain}} {{#vars.nginx_vhost.site.aliases}}{{.}} {{/vars.nginx_vhost.site.aliases}};
location ^~ /.well-known/acme-challenge/ {
alias {{vars.nginx.default_html_dir}}/.well-known/acme-challenge/;
try_files $uri $uri/ =404;
}
2024-09-23 11:40:15 +00:00
access_log /var/log/nginx/{{vars.nginx_vhost.site.domain}}.access.log;
error_log /var/log/nginx/{{vars.nginx_vhost.site.domain}}.error.log;
2024-02-20 17:10:12 +00:00
return 301 https://{{vars.nginx_vhost.site.domain}}$request_uri;
}
server {
listen *:443;
ssl on;
server_name {{vars.nginx_vhost.site.domain}} {{#vars.nginx_vhost.site.aliases}}{{.}} {{/vars.nginx_vhost.site.aliases}};
location ^~ /.well-known/acme-challenge/ {
alias {{vars.nginx.default_html_dir}}/.well-known/acme-challenge/;
try_files $uri $uri/ =404;
}
ssl_certificate {{vars.nginx_vhost.ssl_cert}};
ssl_certificate_key {{vars.nginx_vhost.ssl_key}};
# ssl_dhparam /etc/nginx/dhparam.pem;
2024-09-23 11:40:15 +00:00
access_log /var/log/nginx/{{vars.nginx_vhost.site.domain}}.access.log;
error_log /var/log/nginx/{{vars.nginx_vhost.site.domain}}.error.log;
2024-02-20 17:10:12 +00:00
root {{vars.nginx_vhost.site.doc_root}};
2024-02-21 14:55:00 +00:00
{{{vars.nginx_vhost.site.raw}}}
2024-02-20 17:10:12 +00:00
}
{{/vars.nginx_vhost.site.ssl}}