4

What is this NGINX location for PHP FPM fastcgi_pass 127.0.0.1:9000 really doing?

Here's my locations and I have no errors, but I'd rather fully understand that line.

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { include snippets/fastcgi-php.conf; # With php7.0-cgi alone: # With php7.0-fpm: #fastcgi_pass 127.0.0.1:9000; #What is this doing? fastcgi_pass unix:/run/php/php7.0-fpm.sock; } 

1 Answer 1

3

fastcgi_pass 127.0.0.1:9000; is a commented line, it does nothing. You can uncomment it and comment fastcgi_pass unix:/run/php/php7.0-fpm.sock; to connect to php-fpm using tcp instead of unix socket. You will probably need to reconfigure php-fpm as well to do that.

3
  • 1
    Thanks Sergey, I was just pasting it - but what does the line do? (if uncommented out)? Does it send local machine webcalls to port 9000? (IE things that wouldn't work from browser outside the local console? Just the basic of what that line 'would do'? Commented Feb 25, 2022 at 17:36
  • No, webcalls are processed by nginx. Is would only make nginx <-> php-fpm communication happen though port 9000. Commented Feb 25, 2022 at 17:56
  • Does file ./php/index.php must be accessible by nginx (eg. mounted or copied as usually is)? Commented Mar 9 at 21:32

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.