First, I installed Winginx in the system folder on my computer, very vain .. What I realized was quite late. Everything worked until I had to wield files on the server and had to move the server to another location. I deleted the entire WinGinx folder, turned on the installer, set it again in "C: \ Winginx".
I checked localhost, everything works, added a new project, threw files from the previous server, I get "504 Gateway Time-out". Long tormented with timeouts, put fastcgi_connect_timeout 10; , but it was 10 seconds of useless waiting, and before that I hadn’t even built anything to make the site work.
localhost / phpinfo.php works fine, but other projects do not run php files for some reason. On localhost, by default, there are no configs, I did not set anything. Any project will load all files except .php.
In the logs when connecting, I get the following error:
[notice] signal process started
[error] 16060 # 7760: * 17 upstream timed out (10060:) client: 127.0.0.1, server: my domain, request: "GET / HTTP / 1.1", upstream: "fastcgi: //127.0.0.1: 9000", host: "my domain"
What it is? The last time everything worked perfectly! Moreover, it says that problems with timeouts, this can not be. The site is not loaded, and last time I did not change the timeouts. Plus, I set the timeouts to 60s, which just delayed the wait until error 504.
I rummaged in the network on this topic, found information about php-fpm, but did not understand what it was and why, although many requested configs for it, and I don’t have them anywhere, I checked everything.
There is a line in nginx configs:
fastcgi_pass localhost:9071; There is a similar line in the site configurations:
fastcgi_pass 127.0.0.1:9000; When I looked at what ports are busy, I noticed that port 9000 is completely absent, and port 9071 is busy with the php-cgi.exe process. (although the default should be port 9000, but I did not change anything).
I use Winginx, Windows 10, nginx version 1.12.0, PHP Version 7.1.5. If you need any additional information - ask, I'm not sure what else to provide to resolve the issue.
Thank you for attention!
Site configs look like this, I haven't even changed them:
server { listen 127.0.0.1:80; server_name music-portfolio.com www.music-portfolio.com; root home/music-portfolio.com/public_html/; index index.php index.html; log_not_found off; access_log logs/music-portfolio.com-access.log; charset utf-8; location ~ /\. { deny all; } location = /favicon.ico { } location = /robots.txt { } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root/$fastcgi_script_name; include fastcgi_params; } } nginx.conf:
#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; pid temp/nginx.pid; events { worker_connections 1024; } http { server_names_hash_bucket_size 128; include mime.types; default_type application/octet-stream; log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; client_max_body_size 55m; #gzip on; scgi_temp_path temp/uwsgi_temp 1 2; uwsgi_temp_path temp/uwsgi_temp 1 2; fastcgi_connect_timeout 1; server { listen 127.0.0.1:80; root home/localhost/public_html; index index.php index.html; log_not_found off; charset utf-8; access_log logs/access.log main; location ~ /\. {deny all;} location / { if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){ root home/$2/public_html; access_log logs/$2-access.log main; } } location ~ \.php$ { if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){ root home/$2/public_html; access_log logs/$2-access.log main; } if (!-e $document_root$document_uri){return 404;} fastcgi_pass localhost:9071; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } server { listen 127.0.0.1:443; include ssl.conf; root home/localhost/public_html; index index.php index.html; log_not_found off; charset utf-8; access_log logs/access.log main; location ~ /\. {deny all;} location / { if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){ root home/$2/public_html; access_log logs/$2-access.log main; } } location ~ \.php$ { if ($host ~ ^(www\.)?([a-z0-9\-\.]+)$){ root home/$2/public_html; access_log logs/$2-access.log main; } if (!-e $document_root$document_uri){return 404;} fastcgi_pass localhost:9071; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } } include tools-*.conf; include vhosts/*.conf; } 