diff --git a/nginx/themes.conf.template b/nginx/themes.conf.template index 62f0bc55..beb743e2 100644 --- a/nginx/themes.conf.template +++ b/nginx/themes.conf.template @@ -5,11 +5,25 @@ server { error_log /var/log/nginx/error.log; root /var/www; + client_body_buffer_size 1K; + client_header_buffer_size 1k; + client_max_body_size 1k; + + # Block download agents + if ($http_user_agent ~ LWP::Simple|BBBike|wget) { + return 403; + } + + # Block some robots + if ($http_user_agent ~ msnbot|scrapbot) { + return 403; + } + location / { - expires 1M; + expires 1w; sendfile on; tcp_nopush on; tcp_nodelay on; add_header Cache-Control "public"; } -} +} \ No newline at end of file