Now go to /etc/php/ folder, you should be able to see the “7.2” folder.
Step 2
Change php-fpm running user:group. Go to /etc/php/7.2/fpm/pool.d, edit the “www.conf" file. Change the “user” and “group” to the user you want, e.g. “nobody”, “nogroup”.
Then restart fpm:
1
$ service php7.2-fpm restart
Step 3
You could now check the fpm’s running UDS at path: /var/run/php/php-fpm.sock. Change its permission if needed.
#### config log file error_log /path/to/nextcloud_logs/nginx-err.log warn; access_log /path/to/nextcloud_logs/nginx-access-$year$month$day.log combined; #### end of config log file // if you only allow certain IPs to access allow127.0.0.1; allow67.65.102.103; deny all; client_max_body_size1024M; fastcgi_buffers644K;
location = /robots.txt { allow all; log_not_foundoff; access_logoff; } location ^~ /.well-known { # The rules in this block are an adaptation of the rules # in `.htaccess` that concern `/.well-known`.
# Let Nextcloud's API for `/.well-known` URIs handle all other # requests by passing them to the front-end controller. return301 /index.php$request_uri; } location~ ^/(?:build|tests|config|lib|3rdparty|templates|data)(?:$|/) { return404; } location~ ^/(?:\.|autotest|occ|issue|indie|db_|console) { return404; } # if you want to change shared files' access # shared file in nextcloud will start with /index.php/s/ # so here we add "allow all" for this path location~ ^/index.php/s/ { allow all; fastcgi_split_path_info ^(.+?\.php)(/.*)$; set $path_info $fastcgi_path_info;
fastcgi_param modHeadersAvailable true; fastcgi_pass nextcloud-handler; # uncomment the next line if you don't want to show "index.php" in the url # fastcgi_param front_controller_active true; fastcgi_intercept_errorson; fastcgi_request_bufferingoff; } location~ \.(?:css|js|svg|gif|png|jpg|ico)$ { try_files $uri /index.php$request_uri; expires6M; # Cache-Control policy borrowed from `.htaccess` access_logoff; # Optional: Don't log access to assets }
After you config this and restart nginx, if nginx show 500 error but didn’t log anywhere, to debug, you can just go to your nextcloud folder, find the index.php file, then before each line where throw the 500 error, just add echo to print that error out in the webpage. For example: