RechercheTech / mss

Main MSS feature tracking repo. Also the place for default MSS issues fallinng under no other repo.
1 stars 3 forks source link

kolibri: nginx configuration for serving via path prefix kolibri/ #127

Closed cyberorg closed 4 years ago

cyberorg commented 4 years ago

The following is needed in nginx config

location /kolibri/static { alias /home/mssadmin/.kolibri/static; expires 365d; add_header Cache-Control "public"; } location /kolibri/content { alias /home/mssadmin/.kolibri/content; expires 365d; add_header Cache-Control "public"; } location /kolibri { include uwsgi_params; uwsgi_pass unix://tmp/kolibri_uwsgi.sock; error_page 502 @error502; }

for non kolibri-server

location /kolibri {
    proxy_set_header Host $host;
    proxy_pass http://127.0.0.1:8080;
    error_page 502 @Error502;
}

and in /home/mssadmin/.kolibri/options.ini

URL_PATH_PREFIX = kolibri/

intelliant01 commented 4 years ago

Check this file after installation of kolibri-server :

/etc/nginx/conf.d/kolibri.conf -> /etc/kolibri/dist/nginx.conf

This is on MSS already.

intelliant01 commented 4 years ago

@cyberorg Why is this needed? On NUC, MSS everything seems configured fine with the default kolibri-server package. On Pi, we are not yet using kolibri-server. We may do so when we have native package released.

cyberorg commented 4 years ago

even on pi at least this change will be needed:

/home/mssadmin/.kolibri/options.ini

URL_PATH_PREFIX = kolibri/

This is needed so that access to kolibri is done using mss.server/kolibri instead of mss.server:8080/kolibri,

Using nginx proxy will allow the use of kolibri content by moodle without kolibri running.

intelliant01 commented 4 years ago

Interesting, will have to check how I have been accessing it on the MSS. Could it be possible that Kolibri is accessible simultaneously via port :8080 and kolibri/ ?

cyberorg commented 4 years ago

yes, 8080 and socket are both available.

cyberorg commented 4 years ago

installserver/mss/nginx-kolibri.tar.xz has 2 configuration files needed.

intelliant01 commented 4 years ago
  1. Can't the above be achieved by the following setting in options.ini along with the kolibri-server package without the need of custom entries in mss.conf -
[Deployment]
URL_PATH_PREFIX = kolibri/
HTTP_PORT = 80

Ref: https://kolibri.readthedocs.io/en/latest/manage/options_ini.html?highlight=HTTP_PORT#run-kolibri-from-a-different-port

Going by the Kolibri documentation, it should have worked. I tried the above in options.ini and by commenting the above directives in mss.conf but it did not work.

  1. Using nginx proxy will allow the use of kolibri content by moodle without kolibri running.

Needs to be validated for multiple content types such as HTML5, pdf, epub, etc . Will it work by directly referring the content's link/url or will they need to be embedded using the Kolibri render iframe?

cyberorg commented 4 years ago

HTTP_PORT = 80 Port 80 is in use by nginx so that wont work.