WIP: generiek nginx role
This commit is contained in:
parent
ea3b17ef2d
commit
8df1cba71c
14 changed files with 278 additions and 15 deletions
36
roles/nginx/templates/site.conf.j2
Normal file
36
roles/nginx/templates/site.conf.j2
Normal file
|
@ -0,0 +1,36 @@
|
|||
# {{ ansible_managed }}
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
listen [::]:443 ssl http2;
|
||||
|
||||
server_name {{ site.server_name|default(inventory_hostname) }}{% if site.server_alias is defined %} {{ site.server_alias }}{% endif %};
|
||||
|
||||
include /etc/nginx/tls_params;
|
||||
ssl_certificate /var/lib/dehydrated/certs/{{ site.server_name }}/fullchain.pem;
|
||||
ssl_certificate_key /var/lib/dehydrated/certs/{{ site.server_name }}/fullkey.pem;
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/{{ site.server_name }}.access.log bitlair;
|
||||
error_log /var/log/nginx/{{ site.server_name }}.error.log;
|
||||
|
||||
{% if site.localproxy is defined %}
|
||||
location / {
|
||||
proxy_pass http://localhost:{{ site.localproxy }}/;
|
||||
include proxy_params;
|
||||
}
|
||||
{% endif %}
|
||||
|
||||
# Include snippets
|
||||
{% for file in site.snippets | default([]) %}
|
||||
{% include "../../../snippets/" . file %}
|
||||
{% endif %}
|
||||
|
||||
# Per site configuration
|
||||
{% for line in site.config | default([]) %}
|
||||
{{ line }}
|
||||
{% endfor %}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue