Score:0

nginx exclude image.php from rate limits

pk flag

/etc/nginx/nginx.conf

limit_conn_zone $binary_remote_addr zone=addr:10m;
limit_req_zone $binary_remote_addr zone=foo:10m rate=3r/s;
limit_conn addr 3;

In my sites block I have

    location / {        include conf.d/includes-optional/cpanel-proxy.conf;
        proxy_pass $scheme://$CPANEL_APACHE_PROXY_REQ_IP:$CPANEL_APACHE_PROXY_REQ_PORT;
limit_req zone=foo burst=300 nodelay;
limit_conn addr 1;
limit_rate 200k;
limit_rate_after 1m;
    }

The problem I have is when a visitor loads certain pages there could be dozens/hundreds of images to load. The nginx log gets spammed with the following and the user only loads some of the images.

How can I exclude image.php or perhaps there is another way to slow the load.

GET /image.php?image=%2Fwebroot%2F%2Ffiles%2Fuploads%2F5b27ea535443.jpg&width=255&cropratio=4%3A6&quality=60
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.