2020-05-21 22:15:33 +02:00
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
server {
|
|
|
|
listen 80;
|
|
|
|
listen [::]:80;
|
2021-03-28 10:48:06 +02:00
|
|
|
server_name {{ mumble_web_domains | join(' ') }};
|
2020-05-21 22:15:33 +02:00
|
|
|
|
|
|
|
location / {
|
|
|
|
return 301 https://$host$request_uri;
|
|
|
|
}
|
|
|
|
|
2020-12-26 14:40:54 +01:00
|
|
|
{% if acme_enabled %}
|
2020-05-21 22:15:33 +02:00
|
|
|
location ^~ /.well-known/acme-challenge/ {
|
|
|
|
allow all;
|
2020-12-30 14:27:29 +01:00
|
|
|
root {{ acme_root_dir }};
|
2020-05-21 22:15:33 +02:00
|
|
|
try_files $uri =404;
|
|
|
|
}
|
|
|
|
{% endif %}
|
2021-03-26 18:01:16 +01:00
|
|
|
|
2021-03-28 10:48:06 +02:00
|
|
|
access_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-access.log;
|
|
|
|
error_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-error.log;
|
2020-05-21 22:15:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
server {
|
|
|
|
listen 443 ssl http2;
|
|
|
|
listen [::]:443 ssl http2;
|
|
|
|
|
2021-03-28 10:48:06 +02:00
|
|
|
server_name {{ mumble_web_domains | join(' ') }};
|
2020-05-21 22:15:33 +02:00
|
|
|
|
|
|
|
ssl_certificate {{ mumble_web_certificate }};
|
|
|
|
ssl_certificate_key {{ mumble_web_private_key }};
|
|
|
|
|
|
|
|
ssl_session_timeout 1d;
|
|
|
|
ssl_session_cache shared:AnsibleSSL:10m; # about 40000 sessions
|
|
|
|
ssl_session_tickets off;
|
|
|
|
|
2021-03-28 10:48:06 +02:00
|
|
|
{% if nginx_dhparam %}
|
|
|
|
ssl_dhparam {{ nginx_dhparam }};
|
2020-05-21 22:15:33 +02:00
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
ssl_protocols TLSv1.2 TLSv1.3;
|
|
|
|
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
|
|
|
|
ssl_prefer_server_ciphers off;
|
|
|
|
|
|
|
|
add_header Strict-Transport-Security "max-age=63072000" always;
|
|
|
|
|
|
|
|
# OCSP stapling
|
|
|
|
ssl_stapling on;
|
|
|
|
ssl_stapling_verify on;
|
|
|
|
|
2020-12-06 14:10:29 +01:00
|
|
|
{% if acme_enabled %}
|
2020-05-21 22:15:33 +02:00
|
|
|
# Verify chain of trust of OCSP response using Root CA and Intermediate certs
|
|
|
|
ssl_trusted_certificate {{ mumble_web_trusted_certificate }};
|
2020-12-06 14:10:29 +01:00
|
|
|
{% endif %}
|
2020-05-21 22:15:33 +02:00
|
|
|
|
|
|
|
location / {
|
2021-03-26 23:48:36 +01:00
|
|
|
root {{ mumble_web_dist_dir }};
|
2020-05-21 22:15:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
location /mumble {
|
2021-03-26 23:48:36 +01:00
|
|
|
proxy_pass http://localhost:{{ mumble_web_websockify_port }};
|
2020-05-21 22:15:33 +02:00
|
|
|
proxy_http_version 1.1;
|
|
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
|
|
proxy_set_header Connection $connection_upgrade;
|
|
|
|
}
|
2021-03-26 18:01:16 +01:00
|
|
|
|
2021-03-28 10:48:06 +02:00
|
|
|
access_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-access.log;
|
|
|
|
error_log {{ nginx_log_dir }}/{{ mumble_web_domains | first }}-error.log;
|
2020-05-21 22:15:33 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
map $http_upgrade $connection_upgrade {
|
|
|
|
default upgrade;
|
|
|
|
'' close;
|
|
|
|
}
|