'Slash arguments' problem

'Slash arguments' problem

by Yons Phan -
Number of replies: 5

Hi everybody,

My system is using Nginx server. To use SCORM packages, I enabled 'Use Slash arguments' feature in Moodle. In addition, I  was instructed by Moodle Docs to configure the server to use this feature using the code below (in nginx.conf location):


location ~ [^ /] \. php (/ | $)

{Fastcgi_split_path_info ^ (. + \. Php) (/.+) $;

  fastcgi_index index.php;

  fastcgi_pass 127.0.0.1:9000 (php-fpm or your socket);

  fastcgi_params include;

  fastcgi_param PATH_INFO $ fastcgi_path_info;

  fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; }


However, I'm facing a problem at the moment when Slash arguments feature is enabled, all images are not displayed on my website.

Please give me some advice. Many thanks.

Average of ratings: -
In reply to Yons Phan

Re: 'Slash arguments' problem

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't know anything about Nginx but no images is the number one symptom of slasharguments not working. 

In reply to Howard Miller

Re: 'Slash arguments' problem

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators

Sorry I don't know anything about Nginx either, but here is a link to the documentation page - Nginx. Hopefully an Nginx expert will come along soon and check that it is correct.

For anyone else reading this discussion, the documentation Using slash arguments may also be of help.

In reply to Yons Phan

Re: 'Slash arguments' problem

by Alex Walker -

With slash arguments, the web service redirects something.php/address/of/file to something.php?file=/address/of/file. Apache with mod_php handles this automatically. NGINX doesn't. You need a rewrite rule to redirect these requests. Don't put it in the 'location' block - put it above (outside) it.

rewrite ^/(.*\.php)(/)(.*) /$1?file=/$3
In reply to Alex Walker

Re: 'Slash arguments' problem

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Alex,
your rewrite rule just works but I strongly suggest people to use a better Nginx configuration to (re)create the correct PATH_INFO support, required by Moodle.

HTH,
Matteo