ansible/roles/share_file_web/templates/nginx/sites-available/sharing_site
Jean-Marie Mineau 75fce8dd8d stuffs
2021-04-05 19:02:21 +02:00

33 lines
603 B
Text

{{ ansible_managed | comment }}
include "/etc/nginx/snippets/connection_upgrade.conf";
server {
listen 80;
listen [::]:80;
server_name {{ item.from }};
# Redirect to https
location / {
return 302 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/nginx/certs/{{ item.from }}.crt;
ssl_certificate_key /etc/nginx/certs/{{ item.from }}.key;
server_name {{ item.from }};
# Logs
access_log /var/log/nginx/{{ item.from }}.log;
error_log /var/log/nginx/{{ item.from }}_error.log;
location / {
alias {{ item.folder }};
}
}