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

View file

@ -6,14 +6,24 @@
{% block location %}
location / {
{% if item.filtron == 'true' %}
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Scheme $scheme;
proxy_pass http://127.0.0.1:4004/;
{% if item.upstream_name is defined %}
proxy_pass {{ item.upstream_proto }}://{{ item.upstream_name }}:{{ item.upstream_port }};
proxy_set_header Host $http_host;
proxy_set_header Connection $http_connection;
proxy_set_header X-Real-IP $remote_addr;

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.
Outdated
Review

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)?
proxy_set_header X-Scheme $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name {{ searx_app_dir }};
{% endif %}
{% else %}
meaz marked this conversation as resolved Outdated

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.
include uwsgi_params;
uwsgi_pass unix:/run/uwsgi/app/searx/socket;
uwsgi_pass unix:{{ searx_socket }};
uwsgi_param HTTP_HOST $host;

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.
Outdated
Review

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

Just did a commit, is that ok with you @muppeth ?
uwsgi_param HTTP_CONNECTION $http_connection;
uwsgi_param HTTP_X_SCHEME $scheme;
uwsgi_param HTTP_X_SCRIPT_NAME {{ searx_app_dir }};
uwsgi_param HTTP_X_REAL_IP $remote_addr;
uwsgi_param HTTP_X_FORWARDED_FOR $proxy_add_x_forwarded_for;
{% endif %}
}
{% endblock %}
{% endblock %}