Skip to content

Can I use [email protected] fpm by fastcgi_pass? #87

Discussion options

You must be logged in to vote

Here is the process I follow to setup Nginx after PHP setup.

  • Check php-fpm's port, by default it should be 9000.
sudo lsof -i -n -P | grep php-fpm
  • Install Nginx and test it.
brew install nginx
sudo nginx
curl http://localhost:8080
  • Edit Nginx config /usr/local/etc/nginx/nginx.conf
    • I would change port 8080 to 80.
      - listen 8080;
      + listen 80;
    • Update index files.
      - index index.html;
      + index index.html index.htm index.php;
    • Add directives to connect Nginx with php-fpm. Use the port from step 1 if you have a different port than 9000.
      location ~ \.php$ {
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass 127.0…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@eyedroot
Comment options

Answer selected by eyedroot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants