Hello Juri You say your PHP Script uses FTP Protocol, so you will need to add another VIP for ftp on port 21 in TCP Mode as shown below
frontend app_front bind *:80 default_backend admin_back backend admin_back mode http balance roundrobin server admin 192.168.11.254:80 check frontend ftp_front bind *:21 default_backend ftp_back backend ftp_back mode tcp balance roundrobin server admin 192.168.11.254:21 <http://192.168.11.254:80> check Regards Andrew Smalley Loadbalancer.org http://www.loadbalancer.org On 16 May 2016 at 14:02, Info (ITpartner.ee) <i...@itpartner.ee> wrote: > Hello, > > > > Really need a help to solve this issue. We have PHP ftp file upload > script. After project migration from regular hosting under HAproxy as a > load balancer, our php file upload script stopped working. > > We receive “504 Gateway Time-out. The server didn't respond in time.” > error after ~30 seconds. Increasing keep-alive time or php execution time > makes no effect. > > By checking php code line by line we realized that ftp_connect, ftp_login > – works fine, but it gets an error after ftp_put request. > > Our haproxy conf looks like this: > > > > frontend app_front > > bind *:80 > > default_backend admin_back > > > > backend admin_back > > mode http > > balance roundrobin > > server admin 192.168.11.254:80 check > > > > Tried “ftp –n” connection directly from server – all fine. Turning off > FirewallD service on both haproxy and “admin_back” server makes no > difference. > > Can you give us any suggestions? > > > > BR, > > Juri >