Just curious since I am not experienced with this stuff, are you talking about a TCP reverse proxy (so it could work with the SSH protocol too)? And would haproxy work equally well to nginx for this?
If I remember right, nginx doesn't support ssh + http(s) on the same port. I'd be happy to learn this isn't correct, though because my personal server only is allowing http through.