Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Update nginx config to route grafana
Browse files Browse the repository at this point in the history
  • Loading branch information
Rados13 committed Jul 9, 2024
1 parent 21db93c commit 5233684
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
24 changes: 15 additions & 9 deletions assets/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ server {
listen 5005;


# Grafana
location /grafana/ {
proxy_pass http://grafana:3000/;
proxy_set_header Host $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;

# Required for Grafana Live WebSocket connections
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}


location /collect {
proxy_pass_request_headers on;
proxy_pass_request_body on;
Expand All @@ -13,15 +28,6 @@ server {
}


location /grafana {
proxy_pass_request_headers on;
proxy_pass_request_body on;
proxy_pass http://grafana:3000;
proxy_set_header Host $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;
}

location / {
root /usr/share/nginx/html/;
Expand Down
6 changes: 6 additions & 0 deletions docker-compose-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ services:
environment:
GF_SECURITY_ADMIN_PASSWORD: "${GF_SECURITY_ADMIN_PASSWORD}"
GF_SECURITY_ADMIN_USER: "${GF_SECURITY_ADMIN_USER}"
GF_SERVER_ROOT_URL: "https://${DOMAIN}/grafana/"
GF_SERVER_SERVE_FROM_SUB_PATH: "true"
# GF_SERVER_DOMAIN: ${DOMAIN}
# GF_SERVER_ENFORCE_DOMAIN: "false"
# GF_SERVER_HTTP_PORT: "3000"
# GF_SERVER_HTTP_ADDR: "0.0.0.0"

loki:
build:
Expand Down

0 comments on commit 5233684

Please sign in to comment.