on master help sign in
Merge pull request #2618 from thezeroalpha/master

Fix security vulnerabilities in provided nginx configuration

commit1d10ae175c0929d383d268f56bfadb304365ccf2 authorAlexandre Flament <alex@al-f.net> dateThu 4 Mar 2021, 11:27 (6 years ago) parent6ba37778736f5b
4 files changed+13−13
docs/admin/filtron.rst+1−1 docs/admin/installation-nginx.rst+8−8 utils/templates/etc/nginx/default.apps-available/morty.conf+1−1 utils/templates/etc/nginx/default.apps-available/searx.conf:filtron+3−3
docs/admin/filtron.rst+1−1
@@ -173,7 +173,7 @@ Use it along with ``nginx`` with the following example configuration.
173173 location /searx {
174174 proxy_pass http://127.0.0.1:4004/;
175175
176− proxy_set_header Host $http_host;
176+ proxy_set_header Host $host;
177177 proxy_set_header Connection $http_connection;
178178 proxy_set_header X-Real-IP $remote_addr;
179179 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
docs/admin/installation-nginx.rst+8−8
@@ -182,7 +182,7 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
182182 location /searx {
183183 proxy_pass http://127.0.0.1:4004/;
184184
185− proxy_set_header Host $http_host;
185+ proxy_set_header Host $host;
186186 proxy_set_header Connection $http_connection;
187187 proxy_set_header X-Real-IP $remote_addr;
188188 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -190,8 +190,8 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
190190 proxy_set_header X-Script-Name /searx;
191191 }
192192
193− location /searx/static {
194− alias /usr/local/searx/searx-src/searx/static;
193+ location /searx/static/ {
194+ alias /usr/local/searx/searx-src/searx/static/;
195195 }
196196
197197
@@ -205,7 +205,7 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
205205 location /morty {
206206 proxy_pass http://127.0.0.1:3000/;
207207
208− proxy_set_header Host $http_host;
208+ proxy_set_header Host $host;
209209 proxy_set_header Connection $http_connection;
210210 proxy_set_header X-Real-IP $remote_addr;
211211 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
@@ -309,8 +309,8 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
309309 proxy_buffering off;
310310 }
311311
312− location /searx/static {
313− alias /usr/local/searx/searx-src/searx/static;
312+ location /searx/static/ {
313+ alias /usr/local/searx/searx-src/searx/static/;
314314 }
315315
316316 The ``X-Script-Name /searx`` is needed by the searx implementation to
@@ -328,8 +328,8 @@ Started wiki`_ is always a good resource *to keep in the pocket*.
328328 uwsgi_pass unix:/run/uwsgi/app/searx/socket;
329329 }
330330
331− location /searx/static {
332− alias /usr/local/searx/searx-src/searx;
331+ location /searx/static/ {
332+ alias /usr/local/searx/searx-src/searx/;
333333 }
334334
335335 For searx to work correctly the ``base_url`` must be set in the
utils/templates/etc/nginx/default.apps-available/morty.conf+1−1
@@ -3,7 +3,7 @@
33location /morty {
44 proxy_pass http://127.0.0.1:3000/;
55
6− proxy_set_header Host \$http_host;
6+ proxy_set_header Host \$host;
77 proxy_set_header Connection \$http_connection;
88 proxy_set_header X-Real-IP \$remote_addr;
99 proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
utils/templates/etc/nginx/default.apps-available/searx.conf:filtron+3−3
@@ -3,7 +3,7 @@
33location ${SEARX_URL_PATH} {
44 proxy_pass http://127.0.0.1:4004/;
55
6− proxy_set_header Host \$http_host;
6+ proxy_set_header Host \$host;
77 proxy_set_header Connection \$http_connection;
88 proxy_set_header X-Real-IP \$remote_addr;
99 proxy_set_header X-Forwarded-For \$proxy_add_x_forwarded_for;
@@ -11,6 +11,6 @@ location ${SEARX_URL_PATH} {
1111 proxy_set_header X-Script-Name ${SEARX_URL_PATH};
1212}
1313
14−location ${SEARX_URL_PATH}/static {
15− alias ${SEARX_SRC}/searx/static;
14+location ${SEARX_URL_PATH}/static/ {
15+ alias ${SEARX_SRC}/searx/static/;
1616}