Rate limit authorization requests

master
dpedu 8 years ago
parent 6b6ce258ed
commit 8b9486e565

@ -7,7 +7,7 @@ RUN useradd --create-home --groups sudo admin ; echo "admin:admin" | chpasswd ;
RUN useradd --create-home znc ; echo "znc:znc" | chpasswd
# Install sshd, znc, znc extras, nginx, pisg
RUN mkdir /var/run/sshd ; apt-get update ; apt-get install -y supervisor vim openssh-server znc znc-python znc-dev dpkg-dev pisg nginx-light
RUN mkdir /var/run/sshd ; apt-get update ; apt-get install -y supervisor vim openssh-server znc znc-python znc-dev dpkg-dev pisg nginx-full
# Get ZNC source
RUN su -c 'cd /home/znc ; apt-get source znc' znc

@ -1,3 +1,5 @@
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
server {
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
@ -5,6 +7,7 @@ server {
index index.html index.htm;
server_name localhost;
location / {
limit_req zone=one;
autoindex on;
try_files $uri $uri/ =404;
auth_basic "Restricted";

Loading…
Cancel
Save