I know that this is an old thread... I'm using HAProxy as well, with the current version (1.860) of webmin, making the changes suggested solves the redirect problem, however, it does cause another issue where command stall out when htiting save. Just thought I'd throw it out there, I'm just going to let the system redirect to port 10000, I don't like it, but I'm tired of altering source code.