I currently have a DigitalOcean Ubuntu 16.04x64 server with Linux Containers to house multiple sites. One of the containers has HAProxy installed and routes incoming traffic to their appropriate containers. Each container has a unique IP Address given to it upon creation.
I ran the following command to create a rule to the iptables nat table:
sudo iptables -t nat -I PREROUTING -i eth0 -p TCP -d your_server_ip/32 --dport 80 -j DNAT --to-destination your_haproxy_ip:80
This works correctly and any domain I have pointed to the server gets redirected to the container its supposed to go to.
I am currently migrating sites from another server and still need the domains pointed there until I have tested the sites on the new server. Also, for future development I would like to access the containers without having a domain name pointed to it yet.
So my question is, how can I edit the above command to create a rule that will allow for sub directories? For example: 22.214.171.124/test or 126.96.36.199/10.23.98.211