summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2022-03-08 18:13:13 +0100
committerMarkus Heiser <markus.heiser@darmarit.de>2022-03-08 18:13:13 +0100
commit8d69ee5e7f5c0115a5db957f2016fee55d4b1ac1 (patch)
tree06c3df486a434124ba70e454adc36898dbdef7f6 /utils
parent5eedd5b72ac2b39bd70b08c179b7bc3b4e6e64a4 (diff)
[mod] Serving static files with uWSGI (searxng.ini)
1. Serving static files with uWSGI by using static file mount points [1]. 2. Expires set to one year since there are hashes [2] [1] https://uwsgi-docs.readthedocs.io/en/latest/StaticFiles.html#mode-3-using-static-file-mount-points [2] https://github.com/searxng/searxng/pull/932 Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'utils')
-rw-r--r--utils/templates/etc/uwsgi/apps-archlinux/searxng.ini9
-rw-r--r--utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket12
-rw-r--r--utils/templates/etc/uwsgi/apps-available/searxng.ini9
-rw-r--r--utils/templates/etc/uwsgi/apps-available/searxng.ini:socket12
4 files changed, 38 insertions, 4 deletions
diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini
index 8fd62b70..aaf55a80 100644
--- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini
+++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini
@@ -85,5 +85,12 @@ http = ${SEARX_INTERNAL_HTTP}
#
# socket = ${SEARX_UWSGI_SOCKET}
+# uwsgi serves the static files
+# expires set to one year since there are hashes
+static-map = /static=${SEARX_SRC}/searx/static
+static-expires = /* 31557600
+static-gzip-all = True
+offload-threads = %k
+
# Cache
-cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1
+cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1
diff --git a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket
index 41ed8c1e..e8facda8 100644
--- a/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket
+++ b/utils/templates/etc/uwsgi/apps-archlinux/searxng.ini:socket
@@ -83,4 +83,14 @@ pythonpath = ${SEARX_SRC}
# mkdir -p ${SEARX_UWSGI_SOCKET}
# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
#
-socket = ${SEARX_UWSGI_SOCKET} \ No newline at end of file
+socket = ${SEARX_UWSGI_SOCKET}
+
+# uwsgi serves the static files
+# expires set to one year since there are hashes
+static-map = /static=${SEARX_SRC}/searx/static
+static-expires = /* 31557600
+static-gzip-all = True
+offload-threads = %k
+
+# Cache
+cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1
diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini b/utils/templates/etc/uwsgi/apps-available/searxng.ini
index 618a01ce..9dad84c1 100644
--- a/utils/templates/etc/uwsgi/apps-available/searxng.ini
+++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini
@@ -84,5 +84,12 @@ http = ${SEARX_INTERNAL_HTTP}
#
# socket = ${SEARX_UWSGI_SOCKET}
+# uwsgi serves the static files
+# expires set to one year since there are hashes
+static-map = /static=${SEARX_SRC}/searx/static
+static-expires = /* 31557600
+static-gzip-all = True
+offload-threads = %k
+
# Cache
-cache2 = name=searxcache,items=2000,blocks=2000,blocksize=4096,bitmap=1
+cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1
diff --git a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket
index d247ec5a..c76d084e 100644
--- a/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket
+++ b/utils/templates/etc/uwsgi/apps-available/searxng.ini:socket
@@ -82,4 +82,14 @@ pythonpath = ${SEARX_SRC}
# mkdir -p ${SEARX_UWSGI_SOCKET}
# chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SEARX_UWSGI_SOCKET}
#
-socket = ${SEARX_UWSGI_SOCKET} \ No newline at end of file
+socket = ${SEARX_UWSGI_SOCKET}
+
+# uwsgi serves the static files
+# expires set to one year since there are hashes
+static-map = /static=${SEARX_SRC}/searx/static
+static-expires = /* 31557600
+static-gzip-all = True
+offload-threads = %k
+
+# Cache
+cache2 = name=searxngcache,items=2000,blocks=2000,blocksize=4096,bitmap=1