四层代理配置
概述
参考:
4 层代理配置
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 10240;
}
stream {
include stream.d/*.conf;
upstream grafana {
server 172.38.40.216:30000;
server 172.38.40.217:30000;
}
upstream prometheus {
server 172.38.40.216:30001 weight=8 max_fails=2 fail_timeout=30s;
server 172.38.40.217:30001 weight=8 max_fails=2 fail_timeout=30s;
}
server {
listen 30000;
proxy_pass grafana;
proxy_connect_timeout 10s;
}
server {
listen 30001;
proxy_pass prometheus;
proxy_connect_timeout 2s;
}
}
http {
}
反馈
此页是否对你有帮助?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.