Comment on [PSA] Watch for the antiyanks troll and consider adjusting your rate limits
Sal@mander.xyz 2 days agoSo, a ‘Comments’ Rate limit: 10, Per second: 60, means a maximum of 10 comments per minute, correct?
Correct, per client IP.
Setting the limits to more reasonable values, like ‘20 posts per minute’, causes the server to stop serving posts. My front page goes blank.
So, I am starting to think that ‘20 pots per minute’ means ‘requesting 20 posts per minute’ and not ‘creating 20 posts per minute’.
I am still having doubts about what these limits mean, but setting reasonable numbers seems to break things, unfortunately.
admiralpatrick@lemmy.world 2 days ago
I replied to your other comment, but most likely cause is the API server not getting the correct client IP. If that’s not setup correctly, then it will think every request is from the reverse proxy’s IP and trigger the limit.
Unless they’re broken again. Rate limiting seems to break every few releases, but my instance was on 0.19.12 before I shut it down, and those values worked.
Sal@mander.xyz 2 days ago
Thanks! Yes, I saw both messages and I am now going through the NGINX config and trying to understand what could be going on. To be honest, Lemmy is the hobby that taught me what a ‘reverse proxy’ and a ‘vps’ are. Answering a question such as ‘Are you sending the client IP in the X-Forwarded-For header?’ is probably straight forward for a professional but for me it involves quite a bit of learning 😅
At location /, my nginx config includes:
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
So, I think that the answer to your question is probably ‘yes’. If you did have these rate limits and they were stable, the more likely explanation is that something about my configuration is sub-optimal. I will look into it and continue learning, but I will need to keep my limits a bit high for the time being and stay alert.
admiralpatrick@lemmy.world 2 days ago
Yeah, you are setting it, but that’s assuming the variable
$proxy_add_x_forwarded_for
has the correct IP. But the config itself is correct.Do you have a separate location block for
/api
by chance, and is theproxy_set_header
directive set there, too? Unless I’m mistaken, location blocks don’t inherit that from the/
location.Sal@mander.xyz 2 days ago
Yes, I see this there. Most of the nginx config is from the ‘default’ nginx config in the Lemmy repo from a few years ago. My understanding is somewhat superficial - I don’t actually know where the variable ‘$proxy_add_x_forwarded_for’ gets populated, for example. I did not know that this contained the client’s IP.
I need to do some reading 😁