E
E
Eugene2019-03-20 13:53:02
linux
Eugene, 2019-03-20 13:53:02

Nginx and php-fpm on different servers. Why does not it work?

Snala set up the whole thing on one server and everything worked fine. Then, for research purposes, I decided to transfer php-fpm to another server. I picked it up there, registered it in www.conf to listen 0.0.0.0:9000
And, of course, in nginx.conf I replaced fastcgi_pass from 127.0.0.1:9000 to 10.29.4.187:9000.
I go to the nginx server with a browser, and it gives me File not found. Moreover, if 10.29.4.187:9000 is replaced with a non-existent server, then error 502 immediately pops up.
What am I missing?
nginx config:
user www-data www-data;
events {}
http {
include /etc/nginx/mime.types;
server {
listen 80;
server_name 10.29.4.189;
root /sites/wordpress;
index index.php index.html;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
include fastcgi_params;
include fastcgi.conf;
fastcgi_pass 10.29.4.187:9000;
}
}
}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question