From 396b7b4aa304fc9d93116d8157baee790a6c8c19 Mon Sep 17 00:00:00 2001 From: shenlan Date: Fri, 29 Aug 2025 20:57:58 +0800 Subject: [PATCH] nginx: add grafana vhost template --- .../roles/vhosts/nginx/templates/grafana.conf.j2 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/playbooks/roles/vhosts/nginx/templates/grafana.conf.j2 b/playbooks/roles/vhosts/nginx/templates/grafana.conf.j2 index 14ec0e1..fa8ca8f 100644 --- a/playbooks/roles/vhosts/nginx/templates/grafana.conf.j2 +++ b/playbooks/roles/vhosts/nginx/templates/grafana.conf.j2 @@ -1,6 +1,7 @@ server { listen 443 ssl http2; server_name {{ vhosts_nginx_grafana_domain }}; + ssl_certificate {{ vhosts_nginx_ssl_certificate }}; ssl_certificate_key {{ vhosts_nginx_ssl_certificate_key }}; @@ -9,10 +10,10 @@ server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; - proxy_read_timeout 300; - proxy_send_timeout 300; proxy_pass http://127.0.0.1:3000; } + + # Websocket location /api/live/ { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; @@ -20,4 +21,9 @@ server { proxy_pass http://127.0.0.1:3000; } } -server { listen 80; server_name {{ vhosts_nginx_grafana_domain }}; return 301 https://$host$request_uri; } + +server { + listen 80; + server_name {{ vhosts_nginx_grafana_domain }}; + return 301 https://$host$request_uri; +}