summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorMarkus Heiser <markus.heiser@darmarit.de>2020-04-11 13:19:11 +0200
committerMarkus Heiser <markus.heiser@darmarit.de>2020-04-11 13:19:11 +0200
commit58d5da8b57c5aeab92f551e8d175be67537c351c (patch)
tree5c75c0d6b3fd80c05c592b7dc28bd8ddd90e91a7 /docs
parent67afa6b1fbb635626f278958980b87d3e8fed12c (diff)
downloadsearxng-58d5da8b57c5aeab92f551e8d175be67537c351c.tar.gz
searxng-58d5da8b57c5aeab92f551e8d175be67537c351c.zip
nginx: normalize installation (docs and script)s over all distros
This is the revision of the documentation about the varous nginx installation variants. It also implements the nginx installation scripts for morty and filtron. Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
Diffstat (limited to 'docs')
-rw-r--r--docs/admin/filtron.rst17
-rw-r--r--docs/admin/installation-nginx.rst102
2 files changed, 76 insertions, 43 deletions
diff --git a/docs/admin/filtron.rst b/docs/admin/filtron.rst
index 9615cd935..8bf641649 100644
--- a/docs/admin/filtron.rst
+++ b/docs/admin/filtron.rst
@@ -158,6 +158,12 @@ of:
Route request through filtron
=============================
+.. sidebar:: further reading
+
+ - :ref:`filtron.sh overview`
+ - :ref:`installation nginx`
+ - :ref:`installation apache`
+
Filtron can be started using the following command:
.. code:: sh
@@ -171,15 +177,24 @@ Use it along with ``nginx`` with the following example configuration.
.. code:: nginx
- location / {
+ # https://example.org/searx
+
+ location /searx {
proxy_pass http://127.0.0.1:4004/;
proxy_set_header Host $http_host;
+ proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
+ proxy_set_header X-Script-Name /searx;
}
+ location /searx/static {
+ /usr/local/searx/searx-src/searx/static;
+ }
+
+
Requests are coming from port 4004 going through filtron and then forwarded to
port 8888 where a searx is being run. For a complete setup see: :ref:`nginx
searx site`.
diff --git a/docs/admin/installation-nginx.rst b/docs/admin/installation-nginx.rst
index e62c60df6..4ecc54066 100644
--- a/docs/admin/installation-nginx.rst
+++ b/docs/admin/installation-nginx.rst
@@ -159,14 +159,22 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: nginx
- location / {
- proxy_pass http://127.0.0.1:4004/;
+ # https://example.org/searx
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Scheme $scheme;
- }
+ location /searx {
+ proxy_pass http://127.0.0.1:4004/;
+
+ proxy_set_header Host $http_host;
+ proxy_set_header Connection $http_connection;
+ proxy_set_header X-Real-IP $remote_addr;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Scheme $scheme;
+ proxy_set_header X-Script-Name /searx;
+ }
+
+ location /searx/static {
+ /usr/local/searx/searx-src/searx/static;
+ }
2. Configure reverse proxy for :ref:`morty <searx morty>`, listening on
@@ -174,10 +182,13 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: nginx
- location /morty {
+ # https://example.org/morty
+
+ location /morty {
proxy_pass http://127.0.0.1:3000/;
proxy_set_header Host $http_host;
+ proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Scheme $scheme;
@@ -197,7 +208,7 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
image_proxy : True
- .. group-tab:: proxy or uWSGI
+ .. group-tab:: proxy or uWSGI
Be warned, with this setup, your instance isn't :ref:`protected <searx
filtron>`. Nevertheless it is good enough for intranet usage and it is a
@@ -208,15 +219,17 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: nginx
- location / {
- proxy_pass http://127.0.0.1:8888;
+ # https://hostname.local/
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Scheme $scheme;
- proxy_set_header X-Script-Name /searx;
- proxy_buffering off;
- }
+ location / {
+ proxy_pass http://127.0.0.1:8888;
+
+ proxy_set_header Host $host;
+ proxy_set_header Connection $http_connection;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Scheme $scheme;
+ proxy_buffering off;
+ }
Alternatively you can use the `uWSGI support from nginx`_ via unix
sockets. For socket communication, you have to activate ``socket =
@@ -234,8 +247,8 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: nginx
server {
- # replace example.org with your server's public name
- server_name example.org;
+ # replace hostname.local with your server's name
+ server_name hostname.local;
listen 80;
listen [::]:80;
@@ -245,7 +258,7 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
uwsgi_pass unix:/run/uwsgi/app/searx/socket;
}
- root /usr/local/searx/searx-src/searx;
+ root /usr/local/searx/searx-src/searx;
location /static { }
}
@@ -254,10 +267,10 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: bash
- mkdir -p /run/uwsgi/app/searx/
- sudo -H chown -R searx:searx /run/uwsgi/app/searx/
+ mkdir -p /run/uwsgi/app/searx/
+ sudo -H chown -R searx:searx /run/uwsgi/app/searx/
- .. group-tab:: proxy at subdir URL
+ .. group-tab:: \.\. at subdir URL
Be warned, with these setups, your instance isn't :ref:`protected <searx
filtron>`. The examples are just here to demonstrate how to export the
@@ -265,19 +278,22 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: nginx
- location /searx {
- proxy_pass http://127.0.0.1:8888;
+ # https://hostname.local/searx
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Scheme $scheme;
- proxy_set_header X-Script-Name /searx;
- proxy_buffering off;
- }
+ location /searx {
+ proxy_pass http://127.0.0.1:8888;
+
+ proxy_set_header Host $host;
+ proxy_set_header Connection $http_connection;
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
+ proxy_set_header X-Scheme $scheme;
+ proxy_set_header X-Script-Name /searx;
+ proxy_buffering off;
+ }
- location /searx/static {
- alias /usr/local/searx/searx-src/searx/static;
- }
+ location /searx/static {
+ alias /usr/local/searx/searx-src/searx/static;
+ }
The ``X-Script-Name /searx`` is needed by the searx implementation to
calculate relative URLs correct. The next example shows a uWSGI
@@ -286,15 +302,17 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
.. code:: nginx
- location /searx/static {
- alias /usr/local/searx/searx-src/searx;
- }
+ # https://hostname.local/searx
+
+ location /searx {
+ uwsgi_param SCRIPT_NAME /searx;
+ include uwsgi_params;
+ uwsgi_pass unix:/run/uwsgi/app/searx/socket;
+ }
- location /searx {
- uwsgi_param SCRIPT_NAME /searx;
- include uwsgi_params;
- uwsgi_pass unix:/run/uwsgi/app/searx/socket;
- }
+ location /searx/static {
+ alias /usr/local/searx/searx-src/searx;
+ }
For searx to work correctly the ``base_url`` must be set in the
:origin:`searx/settings.yml`.