list network connections

netstat -na |awk '{print $5}' |cut -d "." -f1,2,3,4 |sort |uniq -c |sort -nr

ss -4 |awk '{print $6}' |cut -d "." -f1,2,3,4 |sort |uniq -c |sort -nr

These lines both returns all the connections open on the server and the destination:port.
On a proxy, it returns all the connections open towards the back-ends.

send custom host to backend

how to change the “Host” variable in the http header sent to the backend.

for example, your browser calls www.site.com but the backend expects www.website.com.

add the following two lines to the proxy rule for www.site.com:

...
set $my_host "www.website.com";
...
location / {
    ...
    proxy_set_header Host $my_host;
    proxy_pass ....