9
edits
m (→..using Nginx: sudo apt-get instead of simple aptitude for more compatibility) |
(→..using Nginx: add comments for kiwix-serve / kiwix-manage usage) |
||
(One intermediate revision by the same user not shown) | |||
Line 107: | Line 107: | ||
limit_req_zone $binary_remote_addr zone=four:1m rate=4r/s; | limit_req_zone $binary_remote_addr zone=four:1m rate=4r/s; | ||
# Default server configuration | # Default server configuration, proxying requests to a kiwix-serve instance running on port 4201 | ||
# | |||
# - add zim files to a library.xml, see http://www.kiwix.org/wiki/Kiwix-manage | |||
# chown www-data *.zim library.xml | |||
# | |||
# - then start kiwix-serve (uses dropped privileges, like nginx itself): | |||
# sudo -u www-data -g adm bash -c 'kiwix-serve --port=4201 --library library.xml &>/dev/null &' | |||
# | |||
server { | server { | ||
# comment next three lines if connection or request rate limits are not needed | # comment next three lines if connection or request rate limits are not needed | ||
Line 142: | Line 149: | ||
location ~ ^/([^/]*_all_|mw|random|search|skin|suggest)(.*)$ { | location ~ ^/([^/]*_all_|mw|random|search|skin|suggest)(.*)$ { | ||
# Choose these links as "Home" pages within respective wikis (adjust to your needs) | # Choose these links as "Home" pages within respective wikis (adjust to your needs) | ||
rewrite ^/wikipedia_de_all_nopic_2014-11/$ | rewrite ^(/wikipedia_de_all_nopic_2014-11)/$ $1/A/Würmeiszeit.html break; | ||
rewrite ^/rezeptewiki_de_all_2014-06/$ | rewrite ^(/rezeptewiki_de_all_2014-06)/$ $1/A/html/L/ä/u/t/Läuterzucker.html break; | ||
# Skip logging certain uris (each tex formula is a png in zim files..) | # Skip logging certain uris (each tex formula is a png in zim files..) |
edits