It has already been asked on this forum, but topic is 9 months old so I’ll create a new one. Issue is identical as original poster.
I have installed a Moodle, but I have a problem with slash arguments, since when entering url such as https://example.com/blocks/xp/index.php/config/1 indicates a 404 page error. All other Moodle pages works fine.
Below is my edited Moodle nginx template and I already tried these two configurations that doesn’t work (I’ll paste only changed elements of conf file, since everything else is exactly the same as in hestia moodle template file):
rewrite ^/(blocks/xp/..php)(/)(.)$ /$1?_r=/$3 last;
rewrite ^/(..php)(/)(.)$ /$1?file=/$3 last;
This second conf also doesn’t work:
location ~* ^/blocks/xp/ {
try_files $uri $uri/ /blocks/xp/index.php?$args;
}
location ~* ^/blocks/xp/index.php/(infos|ladder|report|config)/1$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
include /etc/nginx/fastcgi_params;
fastcgi_index index.php;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_pass %backend_lsnr%;
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
}
location ~* ^/(.*\.php)(/)(.*)$ {
rewrite ^/(.*\.php)(/)(.*)$ /$1?file=/$3 last;
}
While writing this topic I found this link on moodle documentation page: Nginx - MoodleDocs and it suggests adding new block, which I did, but it still doesn’t work. Here’s my third try:
location ~ ^/blocks/xp/index.php/(infos|ladder|report|config)/1 {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass %backend_lsnr%;
include %home%/%user%/conf/web/%domain%/nginx.fastcgi_cache.conf*;
}
Any help or a hint would be highly appreciated.