63 lines
1.8 KiB
Plaintext
63 lines
1.8 KiB
Plaintext
# ============================================
|
|
# 运维监控面板 - dash.dxz99wyr.cn
|
|
# ============================================
|
|
|
|
# 上游定义
|
|
upstream dashy_upstream {
|
|
server dashy:8080;
|
|
}
|
|
|
|
upstream netdata_upstream {
|
|
server netdata:19999;
|
|
}
|
|
|
|
upstream dash_status_upstream {
|
|
# dash-status 使用 host 网络模式,通过宿主机访问
|
|
server host.docker.internal:5000;
|
|
}
|
|
|
|
# Dashy 主面板
|
|
server {
|
|
listen 80;
|
|
server_name dash.dxz99wyr.cn;
|
|
|
|
access_log /var/log/nginx/dash.access.log main;
|
|
error_log /var/log/nginx/dash.error.log warn;
|
|
|
|
# Dashy Web UI
|
|
location / {
|
|
proxy_pass http://dashy_upstream;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
}
|
|
|
|
# Netdata 监控面板
|
|
location /netdata/ {
|
|
proxy_pass http://netdata_upstream/;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection "upgrade";
|
|
proxy_read_timeout 86400s;
|
|
proxy_buffering off;
|
|
}
|
|
|
|
# Status API
|
|
location /api/ {
|
|
proxy_pass http://dash_status_upstream/api/;
|
|
proxy_http_version 1.1;
|
|
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;
|
|
}
|
|
}
|