小编Joh*_*era的帖子

Moodle 2.3与Nginx vs斜线参数重写

我正在尝试使用nginx最新版本设置Moodle 2.3(不是2.5)ver.之前在这个网站上有一些建议.其中之一:带有Nginx后端的Moodle 2.0.

显然任何人都知道,Moodle正在使用path_info规则发布这样的URL:http://example.com/moodle/pluginfile.php/26/mod_scorm/content/1/index.html.为了逃避所有这些噩梦,Moodle提出禁用UI中的"Slash arguments".哪个好.但不是SCORM播放器,尽管有前一个选项,它正在强制"Slash论证".因此,对于禁用的"Slash参数",一切正常并正常.但我唯一的目标是使用SCORM播放器.

我尝试使用上面链接中的重写规则:

rewrite ^(.*\.php)(/)(.*)$ $1?file=/$3 last;
Run Code Online (Sandbox Code Playgroud)

哪个不适用于2.3-2.5版本.我认为它在1.9中有效.现在Moodle正在使用不同的路径:

http://example.com/moodle/pluginfile.php/26/mod_scorm/content/1/index.html

一些nginx规则:

location ^~ /moodle {
     location ~*    ^.+\.(?:css|js|htc|xml|jpe?g|gif|png|ico|bmp|svg|swf|pdf|docx?|xlsx?|tiff?|txt|rtf|cgi|bat|pl|dll|aspx?|class|otf|ttf|woff|eot|less)$ {
         add_header  Access-Control-Allow-Origin *;
         access_log off;
         expires 30d;
         tcp_nodelay off;
         try_files $uri =404;
     }
     location ~* ^/moodle/.*\.php$ {
         include      includes/fastcgi_params.conf;
         try_files $uri @dynamic;
         fastcgi_split_path_info ^(.+\.php)(/.+)$;  
         fastcgi_param  PATH_INFO       $fastcgi_path_info;
         fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
         fastcgi_read_timeout 1200;
         fastcgi_keep_conn on;
         fastcgi_pass 127.0.0.1:9090;

     }
     rewrite (^.*\.php)(/.*) $1 last;
}
Run Code Online (Sandbox Code Playgroud)

请告知如何解决这个问题.

moodle nginx

11
推荐指数
1
解决办法
4134
查看次数

标签 统计

moodle ×1

nginx ×1