View previous topic :: View next topic |
Author |
Message |
paul_chany Tux's lil' helper


Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Wed Jan 13, 2016 6:11 pm Post subject: Nginx & Moodle |
|
|
Hi,
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: | 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 /
}
}
|
What should I do to solve this problem? _________________ Best, Pali |
|
Back to top |
|
 |
gordonb3 Apprentice

Joined: 01 Jul 2015 Posts: 185
|
Posted: Wed Jan 13, 2016 8:05 pm Post subject: |
|
|
You're missing a global try_files directive that tells nginx to load some default file if the uri is a directory.
Example: Code: | try_files $uri $uri/index.html |
|
|
Back to top |
|
 |
paul_chany Tux's lil' helper


Joined: 01 Aug 2010 Posts: 82 Location: Europe, Serbia
|
Posted: Fri Jan 15, 2016 10:17 am Post subject: |
|
|
Finally I set Nginx, Php-fpm and Moodle.
It works now.
Only the Bubba 2 headless server is to slow to handle http and php requests when I want to set my Moodle site up. _________________ Best, Pali |
|
Back to top |
|
 |
|