I'm trying to setup Moodle with Nginx.
All packages: nginx, moodle have installed with emerge.
I have installed nginx/1.9.7.
I first installed moodle, after that installed moodle with webapp-config.
Now when try to open my Moodle at http://localhost/moodle I get error message:
403 Forbidden
I'm following https://docs.moodle.org/29/en/Nginx .
/etc/nginx/nginx.conf
Code: Select all
server {
listen 80;
server_name cspl.hu www.cspl.hu;
access_log /var/log/nginx/localhost.access_log main;
error_log /var/log/nginx/localhost.error_log info;
root /var/www/localhost/htdocs;
location ~ [^/]\.php(/|$) {
# Test for non-existent scripts or throw a 404 error
# Without this line, nginx will blindly send any request ending in .php to php-fpm
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/run/php-fpm.socket;
include fastcgi_params;
include /etc/nginx/fastcgi.conf;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location /dataroot/ {
internal;
alias /var/www/localhost/moodle/; # ensure the path ends with /
}
}

