Thank you for the help. I found that the problem is caused by Http Auth Digest: https://github.com/samizdatco/nginx-http-auth-digest but I don't think I will get any help from the developer as it's not maintained any more. Last commit was 4 years ago.