Update searx to include limiter unstead of filtron #32

Merged
meaz merged 5 commits from searx_redis into master 2022-11-15 17:18:44 +01:00
Owner
No description provided.
muppeth was assigned by meaz 2022-11-11 16:21:17 +01:00
meaz added 2 commits 2022-11-11 16:21:19 +01:00
muppeth reviewed 2022-11-11 22:16:34 +01:00
@ -14,0 +18,4 @@
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Script-Name /{{ searx_app_dir }};
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://127.0.0.1:8888/;
Owner

Weouldn't it make more sense to use variables to define the upstream just like we do for proxy template?
like proxy_pass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ item.upstream_port }};? It would make it cleaner and we have the logic for it already.

Weouldn't it make more sense to use variables to define the upstream just like we do for proxy template? like `proxy_pass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ item.upstream_port }};`? It would make it cleaner and we have the logic for it already.
Author
Owner

Just did a commit, is that ok with you @muppeth ?

Just did a commit, is that ok with you @muppeth ?
meaz added 1 commit 2022-11-12 10:38:22 +01:00
muppeth reviewed 2022-11-15 07:35:21 +01:00
@ -14,0 +15,4 @@
{% if item.limiter == 'true' %}
proxy_set_header Connection $http_connection;
proxy_set_header X-Script-Name {{ searx_app_dir }};
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
Owner

Those you can add to headers above without the need to specify item.limiter.

Those you can add to headers above without the need to specify item.limiter.
meaz marked this conversation as resolved
muppeth reviewed 2022-11-15 07:36:39 +01:00
@ -14,0 +10,4 @@
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
{% if searx_limiter == 'true' or searx_filtron == 'true' %}
proxy_pass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ item.upstream_port }};
Owner

no need for the if here. whether you use limiter, filtron or non of those, you just fill in the unstream_nme, proto and port accordingly.

no need for the if here. whether you use limiter, filtron or non of those, you just fill in the unstream_nme, proto and port accordingly.
Author
Owner

but here https://searx.github.io/searx/admin/installation-nginx.html#the-nginx-http-server it seems to me that uwsgi_pass unix:/run/uwsgi/app/searx/socket; is set on searx only when filtron is not set and with no proxy_pass

And here: https://docs.searxng.org/admin/installation-nginx.html for searxng, it is https://docs.searxng.org/admin/installation-nginx.html that is set without the proxy_pass

So, should proxy_pass be set in all case (so removing the if case)?

but here https://searx.github.io/searx/admin/installation-nginx.html#the-nginx-http-server it seems to me that `uwsgi_pass unix:/run/uwsgi/app/searx/socket;` is set on searx only when filtron is not set and with no `proxy_pass` And here: https://docs.searxng.org/admin/installation-nginx.html for searxng, it is `https://docs.searxng.org/admin/installation-nginx.html` that is set without the `proxy_pass` So, should `proxy_pass` be set in all case (so removing the if case)?
meaz added 1 commit 2022-11-15 16:07:38 +01:00
meaz added 1 commit 2022-11-15 16:37:16 +01:00
muppeth approved these changes 2022-11-15 17:16:55 +01:00
meaz merged commit a26f5fe40a into master 2022-11-15 17:18:44 +01:00
meaz deleted branch searx_redis 2022-11-15 17:18:45 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Disroot-Ansible/nginx#32
No description provided.