Rate limit authorization requests

This commit is contained in:
dpedu 2015-02-15 11:21:42 -08:00
parent 6b6ce258ed
commit 8b9486e565
2 changed files with 4 additions and 1 deletions

View File

@ -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

View File

@ -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";