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 84122e4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
22 changes: 14 additions & 8 deletions assets/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,32 @@ server {
listen 5005;


location /collect {
proxy_pass_request_headers on;
proxy_pass_request_body on;
proxy_pass http://alloy:8027/collect;
proxy_set_header Host $host;
location /grafana {
rewrite ^/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;

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


location /grafana {

location /collect {
proxy_pass_request_headers on;
proxy_pass_request_body on;
proxy_pass http://grafana:3000;
proxy_pass http://alloy:8027/collect;
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: "http://${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 84122e4

Please sign in to comment.