Update searx to include limiter unstead of filtron #32
1 changed files with 17 additions and 7 deletions
|
@ -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;
|
||||
|
||||
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
muppeth
commented
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;
|
||||
muppeth
commented
Weouldn't it make more sense to use variables to define the upstream just like we do for proxy template? 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.
meaz
commented
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 %}
|
||||
|
|
Loading…
Reference in a new issue
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.
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 noproxy_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 theproxy_pass
So, should
proxy_pass
be set in all case (so removing the if case)?