ActiveSync and webmail freez

I have an issue with newly installed Mail In a Box system. All users are connected thru activesync. Connection works 15 minutes and than every approx 15 minutes it shows demand on password and the klient is disconnected from server. If the password is newly set, it doesnt solve the problem. When try to acces to wemail servis, it shows error Gateway time out… If the service nginx is restarted everythings is ok, but only for approx 15 minutes and the problem is here again. Logfile nginx has 20 MB after 3 days of usage.the part of Nginx error log:

2016/09/16 00:02:19 [error] 32594#0: *6637 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 109.71.214.111, server: mail.l-system.cloud, request: “POST /Microsoft-Server-ActiveSync?Cmd=Ping&User=lukas.chalupa%40l-system.cloud&DeviceId=androidc887432949&DeviceType=Android HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “mail.l-system.cloud” 2016/09/16 00:02:51 [error] 32594#0: *6639 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 109.71.214.111, server: mail.l-system.cloud, request: “POST /Microsoft-Server-ActiveSync?Cmd=ItemOperations&User=stepanka.zuskova%40svjokruzni.cz&DeviceId=androidc195792594&DeviceType=Android HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “mail.l-system.cloud” 2016/09/16 00:03:11 [error] 32594#0: *6641 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 109.71.214.111, server: mail.l-system.cloud, request: “POST /Microsoft-Server-ActiveSync?Cmd=Ping&User=lukas.chalupa%40l-system.cloud&DeviceId=androidc887432949&DeviceType=Android HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “mail.l-system.cloud” 2016/09/16 00:03:51 [error] 32594#0: *6643 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 109.71.214.111, server: mail.l-system.cloud, request: “POST /Microsoft-Server-ActiveSync?Cmd=ItemOperations&User=stepanka.zuskova%40svjokruzni.cz&DeviceId=androidc195792594&DeviceType=Android HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “mail.l-system.cloud” 2016/09/16 00:04:00 [error] 32594#0: *6645 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:01 [error] 32594#0: *6649 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:01 [error] 32594#0: *6653 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:01 [error] 32594#0: *6657 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/lukas.chalupa@l-system.cloud/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/”, host: “127.0.0.1” 2016/09/16 00:04:30 [error] 32594#0: *6663 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:30 [error] 32594#0: *6667 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:30 [error] 32594#0: *6647 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:04:30 [error] 32594#0: *6671 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:31 [error] 32594#0: *6651 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:04:31 [error] 32594#0: *6655 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:04:31 [error] 32594#0: *6659 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:04:49 [error] 32594#0: *6675 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.1”, upstream: “https://127.0.0.1:443/cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/”, host: “127.0.0.1” 2016/09/16 00:04:51 [error] 32594#0: *6661 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 109.71.214.111, server: mail.l-system.cloud, request: “POST /Microsoft-Server-ActiveSync?Cmd=ItemOperations&User=stepanka.zuskova%40svjokruzni.cz&DeviceId=androidc195792594&DeviceType=Android HTTP/1.1”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “mail.l-system.cloud” 2016/09/16 00:05:00 [error] 32594#0: *6665 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:05:00 [error] 32594#0: *6669 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:05:00 [error] 32594#0: *6673 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1” 2016/09/16 00:05:19 [error] 32594#0: *6677 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 127.0.0.1, server: mail.l-system.cloud, request: “OPTIONS /cloud/remote.php/caldav/calendars/stepanka.zuskova@svjokruzni.cz/ HTTP/1.0”, upstream: “fastcgi://unix:/var/run/php5-fpm.sock”, host: “127.0.0.1”

the part log nginx

127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:11:46 +0200] “PROPFIND /cloud/remote.php/carddav/addressbooks/lukas.chalupa@l-system.cloud/contacts/ HTTP/1.1” 207 507 “-” “Z-Push CardDAV/0.6.c” 127.0.0.1 - stepanka.zuskova@svjokruzni.cz [15/Sep/2016:17:11:48 +0200] “PROPFIND /cloud/remote.php/carddav/addressbooks/stepanka.zuskova@svjokruzni.cz/contacts/ HTTP/1.1” 207 509 “-” “Z-Push CardDAV/0.6.c” 127.0.0.1 - stepanka.zuskova@svjokruzni.cz [15/Sep/2016:17:11:51 +0200] “PROPFIND /cloud/remote.php/carddav/addressbooks/stepanka.zuskova@svjokruzni.cz/contacts/ HTTP/1.1” 207 509 “-” “Z-Push CardDAV/0.6.c” 127.0.0.1 - lukas.chalupa@aacf.cz [15/Sep/2016:17:11:52 +0200] “PROPFIND /cloud/remote.php/carddav/addressbooks/lukas.chalupa@aacf.cz/contacts/ HTTP/1.1” 207 500 “-” “Z-Push CardDAV/0.6.c” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.1” 207 577 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.0” 207 565 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.0” 207 565 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.1” 207 577 “-” "ModifiedDAViCalClient"127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.1” 207 198 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.0” 207 187 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.1” 207 198 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.0” 207 187 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.1” 207 577 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.0” 207 565 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.0” 207 565 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/personal/ HTTP/1.1” 207 577 “-” "ModifiedDAViCalClient"127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.1” 207 198 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:04 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.0” 207 187 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:05 +0200] “REPORT /caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.1” 207 198 “-” “ModifiedDAViCalClient” 127.0.0.1 - lukas.chalupa@l-system.cloud [15/Sep/2016:17:12:05 +0200] “REPORT /cloud/remote.php/caldav/calendars/lukas.chalupa@l-system.cloud/contact_birthdays/ HTTP/1.0” 207 187 “-” “ModifiedDAViCalClient”