Skip to content

Commit

Permalink
Merge pull request #42 from cu-devclub/dev
Browse files Browse the repository at this point in the history
Config grafana reverse proxy
  • Loading branch information
spyspoisspuis authored Mar 30, 2024
2 parents 0f2afc0 + 67f797e commit 7de4f0b
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ services:
- ./monitoring/grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
- ./monitoring/grafana/main-dashboard.json:/var/lib/grafana/dashboards/dashboard.json
- ./monitoring/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yml
- ./monitoring/grafana/grafana.ini:/etc/grafana/grafana.ini
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
Expand Down
1 change: 1 addition & 0 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ services:
- ./monitoring/grafana/datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
- ./monitoring/grafana/main-dashboard.json:/var/lib/grafana/dashboards/dashboard.json
- ./monitoring/grafana/dashboard.yml:/etc/grafana/provisioning/dashboards/main.yml
- ./monitoring/grafana/grafana.ini.prod:/etc/grafana/grafana.ini
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
Expand Down
3 changes: 3 additions & 0 deletions monitoring/grafana/grafana.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[server]
root_url = http://localhost/grafana
serve_from_sub_path = true
3 changes: 3 additions & 0 deletions monitoring/grafana/grafana.ini.prod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[server]
root_url = https://search.dhammanava.net/grafana
serve_from_sub_path = true
8 changes: 8 additions & 0 deletions nginx/nginx.dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,13 @@ http {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}

location /grafana/ {
proxy_set_header Host $host;
proxy_pass http://grafana:3000;
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;
}
}
}
8 changes: 8 additions & 0 deletions nginx/nginx.prod.conf
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ http {
proxy_set_header X-Forwarded-Proto $scheme;
}

location /grafana/ {
proxy_set_header Host $host;
proxy_pass http://grafana:3000;
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 ~ /.well-known/acme-challenge/ {
root /var/www/certbot;
}
Expand Down

0 comments on commit 7de4f0b

Please sign in to comment.