Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 8e2c30d

Browse files
committed
fix: [#24] https for grafana with Nginx
1 parent 8a74199 commit 8e2c30d

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

share/container/default/config/nginx.conf

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,16 @@ server
227227
# index index.html index.htm index.nginx-debian.html;
228228
#}
229229

230+
## This is required to proxy Grafana Live WebSocket connections.
231+
#map $http_upgrade $connection_upgrade {
232+
# default upgrade;
233+
# '' close;
234+
#}
235+
#
236+
#upstream grafana {
237+
# server grafana:3000;
238+
#}
239+
#
230240
#server
231241
#{
232242
# listen 443 ssl http2;
@@ -254,23 +264,18 @@ server
254264
# ssl_stapling_verify on;
255265
# resolver 8.8.8.8;
256266
#
257-
# location /
258-
# {
259-
# try_files $uri @grafana-http;
267+
# location / {
268+
# proxy_set_header Host $host;
269+
# proxy_pass http://grafana;
260270
# }
261271
#
262-
# location @grafana-http
263-
# {
264-
# proxy_pass http://grafana:3000;
265-
# add_header X-Frame-Options "SAMEORIGIN" always;
266-
# add_header X-XSS-Protection "1; mode=block" always;
267-
# add_header X-Content-Type-Options "nosniff" always;
268-
# add_header Referrer-Policy "no-referrer-when-downgrade" always;
269-
# add_header Content-Security-Policy "default-src * data: 'unsafe-eval' 'unsafe-inline'" always;
270-
# #add_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload" always;
271-
# # enable strict transport security only if you understand the implications
272-
#
273-
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
272+
# # Proxy Grafana Live WebSocket connections.
273+
# location /api/live/ {
274+
# proxy_http_version 1.1;
275+
# proxy_set_header Upgrade $http_upgrade;
276+
# proxy_set_header Connection $connection_upgrade;
277+
# proxy_set_header Host $host;
278+
# proxy_pass http://grafana;
274279
# }
275280
#
276281
# root /var/www/html;

0 commit comments

Comments
 (0)