Nginx不处理2个并行文件请求

I am executing 2 different PHP files in my project. The first one has a while loop and is dependent on the second one to end this while loop

File 1
Execute while loop
Listen for updates by checking DB
Until no update continue in while or sleep 
If update exit

File 2 
Update the DB 
Exit

What's happening here is that when i start first file the second file does not process POST request until the first one is completed and hence both ends up in timeout. I tried it in WAMP and it works perfectly fine there but as Nginx is a single web worker it not working there. Can you Please tell me why this simple thing does not work in Nginx