Commit ecddc080 authored by Nicolas Gelot's avatar Nicolas Gelot
Browse files

Add rate limit config in nginx about search endpoints

Close: #33
parent bac54536
limit_req_zone $http_x_forwarded_for zone=botlimit:10m rate=3r/s;
server {
listen 80;
server_name _;
......@@ -11,15 +13,18 @@ server {
root /var/www/spot;
location = / {
limit_req zone=botlimit burst=3;
include /etc/nginx/proxy_spot_params;
}
location = /search {
limit_req zone=botlimit burst=3;
include /etc/nginx/proxy_spot_params;
}
location / {
try_files $uri @searx;
}
location @searx {
proxy_pass http://spot:80;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
include /etc/nginx/proxy_spot_params;
}
}
proxy_pass http://spot:80;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_buffering off;
FROM nginx:1.17.6-alpine
COPY etc/nginx/conf.d/spot.conf /etc/nginx/conf.d/default.conf
COPY etc/nginx/proxy_spot_params /etc/nginx/proxy_spot_params
RUN sed -i 's!remote_addr!http_x_forwarded_for!g' /etc/nginx/nginx.conf
COPY --chown=nginx:nginx searx/static /var/www/spot/static
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment