0

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!

Telion
  • 183
  • 1
  • 3
  • 9
  • Error 504 means that your upstream response more then default timeout(if it not set in fastcgi_params), in nginx it 60 seconds. Have you tried to execute .php with only phpinfo()? – Alexander Tolkachev Jun 04 '17 at 19:42
  • @Alexander T just tried. Didn't work. Also, I tried earlier to edit the timeout, I changed it few times, but there was just more time to waste til 504 error. Also, earlier everything worked, until I tryed to move the whole Winginx to another place, I don't know what to do know, there are not many options in setup menu to choose. – Telion Jun 04 '17 at 20:06
  • Could you share nginx and php-fpm logs? – Alexander Tolkachev Jun 04 '17 at 20:11
  • @AlexanderT Sure, here are nginx logs: https://www.dropbox.com/s/y8uguhwgzrzf5dj/error.log?dl=0 I don't know where are php-fpm logs, there are no such in logs directory. – Telion Jun 04 '17 at 20:33
  • @Alexander T looks like I found the core of the problem. I was changing nginx conf file to add `server_names_hash_bucket_size 64;` to it. Somewhy after any change and even after return to original settings with notepad++ server answer is that 504 error. Soooo weird but after like 10 reinstalls I made it work... But still. After ANY edit to nginx.conf it breaks the whole thing and to make it work again I need to reinstall it completely, is there any solution? – Telion Jun 04 '17 at 22:38

1 Answers1

0

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.

Alexander Tolkachev
  • 4,608
  • 3
  • 14
  • 23