1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00

Merge pull request #1970 from holta/kolibri-url-redirect

Enable http://box/kolibri without trailing slash too
This commit is contained in:
A Holt 2019-09-27 14:47:16 -04:00 committed by GitHub
commit c746e6ddd1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View file

@ -24,9 +24,9 @@ kiwix_src_file_linux64: "{{ kiwix_version_linux64 }}.tar.gz"
kiwix_src_file_i686: "{{ kiwix_version_i686 }}.tar.gz"
# Used for Kiwix proxy http://box/kiwix/
kiwix_url: /kiwix/
kiwix_alias_url: /kiwix
kiwix_path: "{{ iiab_base }}/kiwix" # /opt/iiab
kiwix_url_without_slash: /kiwix
kiwix_url: "{{ kiwix_url_without_slash }}/" # /kiwix/
kiwix_path: "{{ iiab_base }}/kiwix" # /opt/iiab/kiwix
# /library/zims contains 3 important things:
# - library.xml

View file

@ -1,9 +1,11 @@
# SEE https://github.com/iiab/iiab/blob/master/roles/kolibri/templates/kolibri.conf.j2
# 2018-08-31: FAILS to enable http://box/kiwix
#RewriteEngine on
#RewriteRule ^{{ kiwix_alias_url }}$ {{ kiwix_url }} [R]
#RewriteRule ^{{ kiwix_url_without_slash }}$ {{ kiwix_url }} [R]
# 2018-08-31: SUCCEEDS in enabling http://box/kiwix
RedirectMatch ^{{ kiwix_alias_url }}$ {{ kiwix_url }}
RedirectMatch ^{{ kiwix_url_without_slash }}$ {{ kiwix_url }}
# 2018-08-31: SUCCEEDS in enabling http://box/kiwix/ & http://box/kiwix/zim & http://box/kiwix/zim/
#ProxyPreserveHost On

View file

@ -12,8 +12,10 @@
# Kolibri folder to store its data and configuration files.
kolibri_home: "{{ content_base }}/kolibri" # /library/kolibri
kolibri_url: /kolibri
kolibri_venv_path: /usr/local/kolibri
kolibri_url_without_slash: /kolibri
kolibri_url: "{{ kolibri_url_without_slash }}/" # /kolibri/
kolibri_venv_path: /usr/local/kolibri # For /usr/local/kolibri/bin/kolibri
# 2018-07-16: IIAB recommends /usr/bin but @arky says this isn't yet possible, due to pip
kolibri_exec_path: "{{ kolibri_venv_path }}/bin/kolibri"

View file

@ -1,3 +1,6 @@
# SEE https://github.com/iiab/iiab/blob/master/roles/kiwix/templates/kiwix.conf.j2
RedirectMatch ^{{ kolibri_url_without_slash }}$ {{ kiwix_url }}
ProxyPreserveHost On
ProxyPass {{ kolibri_url }} http://localhost:{{ kolibri_http_port }}{{ kolibri_url }}
ProxyPassReverse {{ kolibri_url }} http://localhost:{{ kolibri_http_port }}{{ kolibri_url }}