@@ -159,14 +159,22 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
159159
160160 .. code:: nginx
161161
162− location / {
163− proxy_pass http://127.0.0.1:4004/;
162+ # https://example.org/searx
164163
165− proxy_set_header Host $http_host;
166− proxy_set_header X-Real-IP $remote_addr;
167− proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
168− proxy_set_header X-Scheme $scheme;
169− }
164+ location /searx {
165+ proxy_pass http://127.0.0.1:4004/;
166+
167+ proxy_set_header Host $http_host;
168+ proxy_set_header Connection $http_connection;
169+ proxy_set_header X-Real-IP $remote_addr;
170+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
171+ proxy_set_header X-Scheme $scheme;
172+ proxy_set_header X-Script-Name /searx;
173+ }
174+
175+ location /searx/static {
176+ /usr/local/searx/searx-src/searx/static;
177+ }
170178
171179
172180 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*.
174182
175183 .. code:: nginx
176184
177− location /morty {
185+ # https://example.org/morty
186+
187+ location /morty {
178188 proxy_pass http://127.0.0.1:3000/;
179189
180190 proxy_set_header Host $http_host;
191+ proxy_set_header Connection $http_connection;
181192 proxy_set_header X-Real-IP $remote_addr;
182193 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
183194 proxy_set_header X-Scheme $scheme;
@@ -197,7 +208,7 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
197208 image_proxy : True
198209
199210
200− .. group-tab:: proxy or uWSGI
211+ .. group-tab:: proxy or uWSGI
201212
202213 Be warned, with this setup, your instance isn't :ref:`protected <searx
203214 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*.
208219
209220 .. code:: nginx
210221
211− location / {
212− proxy_pass http://127.0.0.1:8888;
222+ # https://hostname.local/
213223
214− proxy_set_header Host $host;
215− proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
216− proxy_set_header X-Scheme $scheme;
217− proxy_set_header X-Script-Name /searx;
218− proxy_buffering off;
219− }
224+ location / {
225+ proxy_pass http://127.0.0.1:8888;
226+
227+ proxy_set_header Host $host;
228+ proxy_set_header Connection $http_connection;
229+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
230+ proxy_set_header X-Scheme $scheme;
231+ proxy_buffering off;
232+ }
220233
221234 Alternatively you can use the `uWSGI support from nginx`_ via unix
222235 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*.
234247 .. code:: nginx
235248
236249 server {
237− # replace example.org with your server's public name
238− server_name example.org;
250+ # replace hostname.local with your server's name
251+ server_name hostname.local;
239252
240253 listen 80;
241254 listen [::]:80;
@@ -245,7 +258,7 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
245258 uwsgi_pass unix:/run/uwsgi/app/searx/socket;
246259 }
247260
248− root /usr/local/searx/searx-src/searx;
261+ root /usr/local/searx/searx-src/searx;
249262 location /static { }
250263 }
251264
@@ -254,10 +267,10 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
254267
255268 .. code:: bash
256269
257− mkdir -p /run/uwsgi/app/searx/
258− sudo -H chown -R searx:searx /run/uwsgi/app/searx/
270+ mkdir -p /run/uwsgi/app/searx/
271+ sudo -H chown -R searx:searx /run/uwsgi/app/searx/
259272
260− .. group-tab:: proxy at subdir URL
273+ .. group-tab:: \.\. at subdir URL
261274
262275 Be warned, with these setups, your instance isn't :ref:`protected <searx
263276 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*.
265278
266279 .. code:: nginx
267280
268− location /searx {
269− proxy_pass http://127.0.0.1:8888;
281+ # https://hostname.local/searx
270282
271− proxy_set_header Host $host;
272− proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
273− proxy_set_header X-Scheme $scheme;
274− proxy_set_header X-Script-Name /searx;
275− proxy_buffering off;
276− }
283+ location /searx {
284+ proxy_pass http://127.0.0.1:8888;
285+
286+ proxy_set_header Host $host;
287+ proxy_set_header Connection $http_connection;
288+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
289+ proxy_set_header X-Scheme $scheme;
290+ proxy_set_header X-Script-Name /searx;
291+ proxy_buffering off;
292+ }
277293
278− location /searx/static {
279− alias /usr/local/searx/searx-src/searx/static;
280− }
294+ location /searx/static {
295+ alias /usr/local/searx/searx-src/searx/static;
296+ }
281297
282298 The ``X-Script-Name /searx`` is needed by the searx implementation to
283299 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*.
286302
287303 .. code:: nginx
288304
289− location /searx/static {
290− alias /usr/local/searx/searx-src/searx;
291− }
305+ # https://hostname.local/searx
306+
307+ location /searx {
308+ uwsgi_param SCRIPT_NAME /searx;
309+ include uwsgi_params;
310+ uwsgi_pass unix:/run/uwsgi/app/searx/socket;
311+ }
292312
293− location /searx {
294− uwsgi_param SCRIPT_NAME /searx;
295− include uwsgi_params;
296− uwsgi_pass unix:/run/uwsgi/app/searx/socket;
297− }
313+ location /searx/static {
314+ alias /usr/local/searx/searx-src/searx;
315+ }
298316
299317 For searx to work correctly the ``base_url`` must be set in the
300318 :origin:`searx/settings.yml`.