• Purchasing a license grants permission to use the software and to get Tech Support. A license purchase doesn't grant customization support.

Limit image (hot-linking) bandwidth on Nginx server

mkerala2

Network license
Beta tester
Joined
Jun 30, 2014
Messages
449
Points
105
If you are looking to control bandwidth usage by images uploaded to your website, this can be implemented by editing Nginx config.

The below code limits bandwidth after loading first 5MB at full speed then speed limited to 500KB/s per request. So smaller images load faster while bigger images loads little slower especially when hot-linking.

Code:
location ^~ /images/
    {
    limit_rate_after 5m;
    limit_rate 500k;
    log_not_found off;
    error_page 404 /content/images/system/default/404.gif;
    }