Simple http:port forwarding?


#1

So currently I am using HAproxy to forward incoming RTMP to a container I created on Ubuntu.
I am using mode tcp in defaults.

Now I also want to forward an http request that comes in on a specific port to the same container with the same port #. Can I declare two modes in the haproxy.cfg? So mode tcp and mode http?

Thanks,

Ray


#2

Different port on the frontend, same backend port? Just configure duplicates with appropriate modificationsa.


#3

I will use the same port on front and back. I’m confused on how to set haproxy.cfg? The backend will be a Ubuntu LXD container on the same server.


#4

Can you make specfic examples using actual port numbers because it is unclear what you are trying to do.


#5

Ok I have an Ubuntu 16.04 server. I have an LXD container. I have an incoming http request on port 8935.
I want to forward it to the container IP on same port.

Ray


#6

Just add something like this. There is no specific issue with what you are trying to achieve, just do it.

listen
 bind :8935
 server server1 192.168.0.5:8935

If you want more specific advise, you need to actually share your current configuration.