Update http2 syntax

This commit is contained in:
2024-04-14 17:30:59 -05:00
parent 4a7f888994
commit f79cdc1e59
4 changed files with 36 additions and 8 deletions

View File

@ -6,6 +6,11 @@ upstream grafana_backend {
server 127.0.0.1:{{ grafana_port }};
}
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
{% if ansible_all_ipv6_addresses | length %}
@ -32,10 +37,13 @@ server {
{% if grafana_ssl_enabled is defined and
grafana_ssl_enabled %}
server {
listen 443 ssl http2;
listen 443 ssl;
{% if ansible_all_ipv6_addresses | length %}
listen [::]:443 ssl http2;
listen [::]:443 ssl;
{% endif %}
http2 on;
server_name {{ grafana_domain }};
access_log /var/log/nginx/grafana.access.log main;
@ -59,7 +67,12 @@ server {
}
location / {
add_header Alt-Svc 'h3=":$server_port"; ma=86400';
limit_req zone=req_bad_actors burst=10 nodelay;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_pass http://grafana_backend;
}
}