From e3c2fc078e61a4ea819540fedc16767e19453959 Mon Sep 17 00:00:00 2001 From: ITQ Date: Sat, 1 Mar 2025 14:22:50 +0300 Subject: [PATCH] (scope): [body] [footer(s)] --- infrastructure/grafana/grafana.ini | 4 ++-- infrastructure/nginx/nginx.conf | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/infrastructure/grafana/grafana.ini b/infrastructure/grafana/grafana.ini index 7f08784..399a5de 100644 --- a/infrastructure/grafana/grafana.ini +++ b/infrastructure/grafana/grafana.ini @@ -48,10 +48,10 @@ domain = localhost enforce_domain = false # The full public facing url -root_url = %(protocol)s://%(domain)s:%(http_port)s/ +root_url = %(protocol)s://%(domain)s:%(http_port)s/admin/grafana/ # Serve Grafana from subpath specified in `root_url` setting. By default it is set to `false` for compatibility reasons. -serve_from_sub_path = false +serve_from_sub_path = true # Log web requests router_logging = false diff --git a/infrastructure/nginx/nginx.conf b/infrastructure/nginx/nginx.conf index 79380d3..838c1e5 100644 --- a/infrastructure/nginx/nginx.conf +++ b/infrastructure/nginx/nginx.conf @@ -155,6 +155,16 @@ http { client_max_body_size 100M; } + location /admin/grafana/ { + rewrite ^/admin/grafana/(.*) /$1 break; + proxy_pass http://grafana:3000/; + + proxy_set_header Host $http_host; + 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; + } + error_page 404 = @notfound; location @notfound { return 444;