iptables, two services on one port
Hi all, I am stuck with a problem I cannot solve. The situation: server connected to the internet and two servers behind it. The idea is that I want to use one and the same port on the outer server for two services, but the two services run on the two servers in the inner network. So if I type let's say: "example.com:8080/http" in the browser, I go to the http server on one of the servers, and when I go to console and type: "mysql -h example.com --port=8080" I get connected to the mysql on the other inner server.
I thought that iptables could check the packet types (if http or other) and if it is http, then just forward to apache, and if not then to mysql.