504 nginx timeout after long periods of inactivity

If i don’t visit my ERP software within a week,

504 timeouts occur after that.

Only restarting supervisor fixes the issue.

Please kindly advise

The only logs written are web.error.log

[2017-06-07 06:09:28 +0000] [1788] [INFO] Listening at: http://127.0.0.1:8000 (1788)
[2017-06-07 06:09:28 +0000] [1788] [INFO] Using worker: sync
[2017-06-07 06:09:28 +0000] [1801] [INFO] Booting worker with pid: 1801
[2017-06-07 06:09:28 +0000] [1802] [INFO] Booting worker with pid: 1802
[2017-06-07 06:09:28 +0000] [1803] [INFO] Booting worker with pid: 1803
[2017-06-07 06:09:28 +0000] [1804] [INFO] Booting worker with pid: 1804
[2017-06-07 06:09:28 +0000] [1809] [INFO] Booting worker with pid: 1809
[2017-06-07 06:09:28 +0000] [1810] [INFO] Booting worker with pid: 1810
[2017-06-16 13:10:40 +0000] [1788] [CRITICAL] WORKER TIMEOUT (pid:1804)
[2017-06-16 13:10:40 +0000] [1804] [INFO] Worker exiting (pid: 1804)
[2017-06-16 13:10:41 +0000] [30813] [INFO] Booting worker with pid: 30813
[2017-06-16 13:12:41 +0000] [1788] [CRITICAL] WORKER TIMEOUT (pid:1809)
[2017-06-16 13:12:41 +0000] [1809] [INFO] Worker exiting (pid: 1809)
[2017-06-16 13:12:41 +0000] [31069] [INFO] Booting worker with pid: 31069
[2017-06-16 13:12:57 +0000] [1788] [CRITICAL] WORKER TIMEOUT (pid:1803)
[2017-06-16 13:12:57 +0000] [1803] [INFO] Worker exiting (pid: 1803)
[2017-06-16 13:12:57 +0000] [31078] [INFO] Booting worker with pid: 31078
[2017-06-16 13:14:58 +0000] [1788] [CRITICAL] WORKER TIMEOUT (pid:1810)
[2017-06-16 13:14:58 +0000] [1810] [INFO] Worker exiting (pid: 1810)
[2017-06-16 13:14:58 +0000] [31334] [INFO] Booting worker with pid: 31334

frappe@server:~/frappe-bench/logs$ ls -l
total 640
-rw-r–r-- 1 frappe frappe 4536 Jun 16 10:00 auto_update_log.log
-rw-r–r-- 1 frappe frappe 0 Apr 6 06:00 backup.log
-rw-r–r-- 1 frappe frappe 8161 Jun 7 06:09 bench.log
-rw-r–r-- 1 frappe frappe 27540 Jun 7 06:23 frappe.log
-rw-r–r-- 1 root root 2671 Apr 6 07:08 node-socketio.error.log
-rw-r–r-- 1 root root 104317 Jun 7 06:09 node-socketio.log
-rw-r–r-- 1 root root 0 Apr 6 04:45 redis-cache.error.log
-rw-r–r-- 1 root root 21292 Apr 6 14:21 redis-cache.log
-rw-r–r-- 1 root root 0 Apr 6 04:45 redis-queue.error.log
-rw-r–r-- 1 root root 21292 Apr 6 14:21 redis-queue.log
-rw-r–r-- 1 root root 0 Apr 6 04:45 redis-socketio.error.log
-rw-r–r-- 1 root root 21292 Apr 6 14:21 redis-socketio.log
-rw-r–r-- 1 root root 0 Apr 6 04:45 schedule.error.log
-rw-r–r-- 1 root root 0 Apr 6 04:45 schedule.log
-rw-r–r-- 1 frappe frappe 37646 Jun 16 13:14 web.error.log
-rw-r–r-- 1 frappe frappe 0 Apr 6 04:45 web.log
-rw-r–r-- 1 frappe frappe 357747 Jun 7 06:47 worker.error.log
-rw-r–r-- 1 frappe frappe 0 Apr 6 04:45 worker.log