ansible/roles/speedtest/templates/vhost.j2

37 lines
731 B
Django/Jinja

server {
listen 80;
listen [::]:80;
server_name {{ speedtest_domains }};
client_max_body_size 64M;
location /.well-known/acme-challenge {
default_type "text/plain";
alias /var/www/acme-challenge;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host;
proxy_set_header Connection $http_connection;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ speedtest_domains }};
ssl_certificate_key /etc/nginx/ssl/{{ speedtest_domain }}.key;
ssl_certificate /etc/nginx/ssl/{{ speedtest_domain }}.crt;
location / {
return 301 http://$host$request_uri;
}
}