Windows – A connection attempt failed because the connected party did not properly respond after a period of time

nginxPHPwindows

After I installed winginx to the system directory, what was foolish, problems with manipulating files on server appeared and I decided to move it to another place. I deleted the whole winginx folder and installed it again to C:\Wingix. Right after that I tried to access the localhost and there was the usual test index.html that opened successfully, localhost/phpinfo.php works fine too now.

After that, I copied all the files to the new project with the new folder and tried to open it in a browser. I got: 504 Gateway Time-out. Later I discovered that .html files on the same domain are still accessible(and all the others files, but .php).

Later I found the line in nginx logs:

[error] 8044#12036: *1 upstream timed out (10060: A connection attempt
failed because the connected party did not properly respond after a
period of time, or established connection failed because connected
host has failed to respond) while connecting to upstream, client:
127.0.0.1, server: music-portfolio.com, request: "GET /index.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host:
"music-portfolio.com"

It says there is a problem with timeouts. That's wrong. Before I started this whole action it was working perfectly fine. So the problem is with some components.

I searched the web about this. People said many things about php-fpm but I couldn't find what is it or why I don't have it on this server. There are no confs for it or files anywhere. The only similar thing tho this is fastcgi.

In Nginx confs the line about fastcgi exists:

fastcgi_pass localhost:9071;

In project confs here is the different one:

fastcgi_pass 127.0.0.1:9000;

When I searched which ports are busy or listening or at least bound to something I couldn't find port 9000 anywhere. But there is 127.0.0.1:9071 LISTENING to php-cgi.exe.

Here is the question very similar to mine: nginx stop/reload on windows failed for Access is denied
I couldn't understand any of its answers.

I don't know where to dig further… Is there anything to help to resolve this?

I use Winginx, Windows 10, nginx version 1.12.0, PHP Version 7.1.5. If there is the need for more information just ask about it I will add it as fast as I can.

Thank you for your attention!

Best Answer

Well, looks like there is something strange with your nginx configuration, I'll offer full reinstall nginx from scratch and change fastcgi_pass from 127.0.0.1:9000 to 127.0.0.1:9071.