1
0
forked from infra/ansible
infra/roles/omm/templates/vhost.j2

31 lines
569 B
Plaintext
Raw Normal View History

2021-11-19 23:23:45 +01:00
server {
listen 80;
listen [::]:80;
server_name {{ omm_domain }};
location /.well-known/acme-challenge {
default_type "text/plain";
alias /var/www/acme-challenge;
}
location / {
return 301 https://{{ omm_domain }}$request_uri;
}
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name {{ omm_domain }};
ssl_certificate_key /etc/nginx/ssl/{{ omm_domain }}.key;
ssl_certificate /etc/nginx/ssl/{{ omm_domain }}.crt;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_pass https://localhost:{{ omm_https_port }};
}
}