You do not understand what’s I’m saying … the issue does not lie in nginx or php … the issue is that the application itself is taking too much time to load the data or answer the request.
When your sandwich takes four hours to be made, the issue is not that you should wait longer. The issue to be investigated is why the sandwich takes four hours to be made instead of 5 minutes. Same here : if your app takes more than 40 seconds to load the page, the issue is not “how do i make nginx/php wait more”, the issue is that at most your app should take 5 seconds to answer the request - so what’s taking so long ?