ansible-ffrgb/roles/web-svc/templates/rev_vhost.j2

31 lines
712 B
Plaintext
Raw Normal View History

2020-06-16 23:42:14 +02:00
server {
listen 80;
listen [::]:80;
server_name {{ rev_domain }}{% if rev_aliases %}{% for alias in rev_aliases %} {{ alias }}{% endfor %}{% endif %};
location /.well-known/acme-challenge {
default_type "text/plain";
alias /var/www/acme-challenge;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ rev_domain }}{% if rev_aliases %}{% for alias in rev_aliases %} {{ alias }}{% endfor %}{% endif %};
ssl_certificate_key /etc/nginx/ssl/{{ rev_domain }}.key;
ssl_certificate /etc/nginx/ssl/{{ rev_domain }}.crt;
location / {
proxy_set_header X-Forwarded-For $remote_addr;
proxy_pass {{ rev_target }};
}
}