-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproxy.conf
More file actions
57 lines (50 loc) · 1.99 KB
/
Copy pathproxy.conf
File metadata and controls
57 lines (50 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
server {
listen 80;
server_name localhost;
# Redirect root to the Grafana dashboard
location = / {
return 301 $scheme://$http_host/monitor/;
}
# Redirect /monitor to /monitor/ to ensure relative paths work correctly.
location = /monitor {
return 301 $scheme://$http_host/monitor/;
}
# Proxy requests for Grafana.
# The trailing slash on proxy_pass is important. It tells Nginx to
# map /monitor/ to the root of the Grafana service.
# e.g., /monitor/dashboards -> http://grafana:3000/dashboards
location /monitor/ {
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;
}
# Redirect /metrics/influxdb to /metrics/influxdb/ to ensure relative paths work correctly.
location = /metrics/influxdb {
return 301 $scheme://$http_host/metrics/influxdb/;
}
# Proxy requests for InfluxDB API.
# The trailing slash on proxy_pass is important. It tells Nginx to
# map /metrics/influxdb/ to the root of the InfluxDB service.
location /metrics/influxdb/ {
proxy_pass http://influxdb:8086/;
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;
}
# Redirect /app to /app/ to ensure relative paths work correctly.
location = /app {
return 301 $scheme://$http_host/app/;
}
# Proxy all requests under /app/ to the Go application.
# The service name is 'app', not 'bda-app'.
location /app/ {
proxy_pass http://app:4000/app;
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;
}
}