Skip to content

Commit

Permalink
fix: use best practices for nginx config (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikitabut authored Nov 14, 2023
1 parent c2e7f1b commit c7d12e6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions nginx/themes.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}
}

0 comments on commit c7d12e6

Please sign in to comment.