I am automating a script for collecting some info, given a specific URL and returning all the server in the upstream Pool for that URL in a running NGINX+ instance.
My goal is to have something that I can query on web, or a script that I can run hourly basis and create an HTML with it that I can query later with my script.
I was planning to extract the info from the dashboard upstreams, but unfortunately the zones aren't descriptive enough and couldn't show all the matching URL in the regex definition for server_name on the config files.
From this running config :
server {
listen 443 ssl http2;
listen[::]:443 ssl http2;
server_name ~^(www|www2|www3).mycompany.com$;
status_zone www.mycompany.com;
.... ....
}
upstream www {
least_time header; zone area1 128k;
server server1.mycompany.com:443 max_fails=3 fail_timeout=30s;
server server2.mycompany.com:443 max_fails=3 fail_timeout=30s;
server server3.mycompany.com:443 max_fails=3 fail_timeout=30s;
}
Want to get from this Input URL : www2.mycompany.com
these Output Servers: server1, server2, server3
any thoughts?
My goal is to have something that I can query on web, or a script that I can run hourly basis and create an HTML with it that I can query later with my script.
I was planning to extract the info from the dashboard upstreams, but unfortunately the zones aren't descriptive enough and couldn't show all the matching URL in the regex definition for server_name on the config files.
From this running config :
server {
listen 443 ssl http2;
listen[::]:443 ssl http2;
server_name ~^(www|www2|www3).mycompany.com$;
status_zone www.mycompany.com;
.... ....
}
upstream www {
least_time header; zone area1 128k;
server server1.mycompany.com:443 max_fails=3 fail_timeout=30s;
server server2.mycompany.com:443 max_fails=3 fail_timeout=30s;
server server3.mycompany.com:443 max_fails=3 fail_timeout=30s;
}
Want to get from this Input URL : www2.mycompany.com
these Output Servers: server1, server2, server3
any thoughts?