File download 504 error

Hello Everyone,

I am trying to download a delivery note using a module. In the google chrome inspection menu. The network shows the file to be pending then it throws 504 error.

Sometimes the shop goes offline and throws 504 gate timeout nginx error aswell.

How can i solve this problem?

increasing the proxy timeout to 3 minutes fixed the issue for now.