Does login break for all users at the same time? Or does it happen at a different time for each user?
The fact it starts working again after some time makes me wonder whether there is a cache involved. Does your NGINX config, or any other intermediate proxy (e.g. cloudflare), perform any caching?