Migration to Nginx now our moodle cannot Display Image

Migration to Nginx now our moodle cannot Display Image

by Rino M Nur -
Number of replies: 3

Dear All, 

We've now migrating our webserver to new webserver using NGINX, but when we test it we can  login to moodle but all the data in moodledata cannot be displayed, 

our log say : 

Jun 21 03:46:34 lms-bsd nginx: 2012/06/21 03:46:34 [error] 1497#0: *1 open() "/www/moodle/pluginfile.php/136/user/icon/f1" failed (20: Not a directory), client: 10.150.4.3, server: localhost, request: "GET /pluginfile.php/136/user/icon/f1 HTTP/1.1", host: "lms-bsd.mydomain.org", referrer: "http://lms-bsd.mydomain.org/user/profile.php?id=124"

What should i have to change in our NGINX conf. I Think the problem is from mod rewrite. 

Our System : 

MOODLE : 2.2 Stable

NGINX with PHP-FPM

FreeBSD 8.2 Stable

Thanks

Average of ratings: -
In reply to Rino M Nur

Re: Migration to Nginx now our moodle cannot Display Image

by Colin Fraser -
Picture of Documentation writers Picture of Testers

What it probably means is that when you migrated, the images and other file links have remained pointing at the previous address. One way around that is to run /admin/replace.php. It will open a window that allows you to enter the previous address and then replace it with the current one. This is a common issue when migrating and the usual solution, it works most of the time. When it does not work, open a course, start the editor, open a page with an image in it, have a look at the HTML and check the url, make sure it is pointing to the right place, that might be more accurate as to what to look for if you do that first or after the next bit, I know it is out of order, but....

You may also want to go to your config.php file and make sure that reflects the new address too - maybe even look at that before you run the replace.php file. If it is your images, then it will probably be all links to files stored inside your Moodle, the replace.php should fix them all.

In reply to Colin Fraser

Re: Migration to Nginx now our moodle cannot Display Image

by Rino M Nur -

Hi Collin Thanks, 

this guide is the answer 

http://docs.moodle.org/dev/Install_Moodle_On_Ubuntu_with_Nginx/PHP-fpm

http://YOURMOODLESITE/admin/search.php?query=slashargument 

but one morething, we cannot view a flv or movie in this site after we uncheck slash argument. Its only display a filename and link.  without a preview a movie.

In reply to Rino M Nur

Re: Migration to Nginx now our moodle cannot Display Image

by Colin Fraser -
Picture of Documentation writers Picture of Testers

Have you turned on the multimedia plugins? Specifically, Plugins > Filters > Multimedia Plugins  .flv is supposed to be activated by default, but check it anyway. I understand that Firefox has dropped support for Adobe Flash, I may be wrong here, but flash thingies don't always work in my Firefox. A lot of videos that "require" Flash do not work for me anymore and I really cannot be bothered to deliberately find out why, something will come up about it on the 'net at some point I imagine.