I have just set up stream pass through using ssl_preread
in nginx, but I can't for the life of me figure out how to, using this method, ban access to specific upstream servers for certain ip ranges.
Such that host1
should not allow 10.0.1.0/24
for example and host2
should not allow 10.0.44.0/24
The solution for me was pretty simple, realized today I could simply split up the configuration into multiple ports and DNAT the ipranges at firewall to the different ports. Then I could keep 443 as the standard https port and still have seperation. This doesn't answer the core of my idea but solves my issue.
Marks this as answer unless someone comes up with a real nginx solution I suppose.