Link Search Menu Expand Document
Table of contents

Change user for nginx config file

user www-data;

add user www-data to the whole nginx config file

Define PHP location

server {
    listen 80;
    server_name 198.255.25.1;
    root /sites/demo; 
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
        }
        
    location ~\.php$ {
        # parse php requests to the php-fpm service (fastCGI)
        include fastcgi.conf; 
        fastcgi_pass unix:/run/php/php7.1fpm.sock
        # run command: `find / -name *fpm.sock`
        # to get the correct php processor version 
        }  
}