Juri Your welcome.
I made an assumption that you would need to also loadbalance port 21 for ftp. Is your php script making a call to an external service or is it behind haproxy? Regards Andrew Smalley Loadbalancer.org http://www.loadbalancer.org On 16 May 2016 at 14:24, Info (ITpartner.ee) <[email protected]> wrote: > Hello Andrew, > > > > Thanks for fast reply! > > I have already tried similar configuration and tried yours, but I get “ > *ERR_CONNECTION_REFUSED*” on any http request to this server. > > > > After removing ftp_front and ftp_back + haproxy restart, all fine again. > > > > // Juri > > > > *From:* Andrew Smalley [mailto:[email protected]] > *Sent:* Monday, May 16, 2016 4:10 PM > *To:* Info (ITpartner.ee) <[email protected]> > *Cc:* HAProxy <[email protected]> > *Subject:* Re: HAproxy and ftp_put response "504 Timeout" > > > > 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) <[email protected]> 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 > > >

