Project

General

Profile

Bug #8035

Nginx static files config for showing html in frames

Added by Martijn Baart almost 4 years ago. Updated over 3 years ago.

Status:
Bug resolved
Priority:
Normal
Category:
System
Target version:
Start date:
06/01/2016
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

After upgrading from 1.9 to 1.10.0 I noticed that I got a 404 when viewing a html document inside a frame. For example, includes in main/document/showinframes.php. This was only behind a nginx server.

- This happens if you look at a html document that is included in: main/document/showinframes.php I get a 404 page in the frame instead of the document itself.
- I can download the documents as PDF.
- The same thing happens when looking at a scorm document.

See https://chamilo.org/forum/viewtopic.php?f=6&t=6872&p=28552#p28552

I edited the config of nginx by adding html to the static files section:

  1. Serve static files directly
    location ~* \.(png|jpeg|gif|ico|html)$ {
    expires 1y;
    access_log off;
    rewrite /courses/([/]+)/course-pic85x85.png$ /app/courses/$1/course-pic85x85.png last;
    rewrite /courses/([/]+)/course-pic.png$ /app/courses/$1/course-pic.png last;
    rewrite /courses/([/]+)/scorm/(.*)$ /main/document/download_scorm.php?doc_url=/$2&cDir=$1 last;
    rewrite /courses/([/]+)/document/(.*)$ /main/document/download.php?doc_url=/$2&cDir=$1 last;
    rewrite /courses/([/]+)/work/(.*)$ /main/work/download.php?file=work/$2&cDir=$1 last;
    rewrite /courses/([/]+)/upload/(.*)$ /app/courses/$1/upload/$2 last;
    try_files $uri @rewrite;
    }

Related issues

Related to Chamilo LMS - Bug #7926: Non-working nginx rewrite rule with multiple paramsBug resolved31/10/2015

Actions

History

#1

Updated by Yannick Warnier almost 4 years ago

  • Category set to System
  • Status changed from New to Assigned
  • Assignee set to Yannick Warnier
#2

Updated by Yannick Warnier almost 4 years ago

  • Status changed from Assigned to Bug resolved
  • % Done changed from 0 to 100

With the nginx config suggestion in the updated installation_guide.html (for 1.10.4), this shouldn't happen anymore (this fixed the issue for me).
Related to #7926

#3

Updated by Martijn Baart over 3 years ago

The new nginx config indeed resolved this issue for me. Thanks!

Also available in: Atom PDF