I have discourse running socketed behind an outer nginx proxy. It works: i can see my posts, create new ones, do backups, restores, etc.
I have used the settings from the inner nginx in the discourse docker (when it was standalone). Therefore i also copied the rate limiting from there, and adapted it a bit, it is presented below.
There is a problem though with my setup: it seems outer nginx is rate-limiting the emoticons box:
cat /var/log/nginx/error.log
[...]
2018/09/05 18:03:51 [error] 32008#32008: *235 limiting requests, excess: 20.295 by zone "flood", client: 193.186.16.206, server: chat.tbp.land, request: "GET /images/emoji/apple/strawberry.png?v=6 HTTP/2.0", host: "chat.tbp.land", referrer: "https://chat.tbp.land/"
2018/09/05 18:03:51 [error] 32008#32008: *235 limiting requests, excess: 20.295 by zone "flood", client: 193.186.16.206, server: chat.tbp.land, request: "GET /images/emoji/apple/pear.png?v=6 HTTP/2.0", host: "chat.tbp.land", referrer: "https://chat.tbp.land/"
What i did with the limit zones was place them inside the http
context, and not in server
, but i don’t think that’s a problem as limit_req can be placed in http
.
Did i miss anything by any chance?
This is my rate-limiting config placed in http
context:
#=================================================
# Rate limit EVERYTHING!!!!!!!
# rate limiting zones
limit_req_zone $binary_remote_addr zone=flood:10m rate=15r/s;
limit_req_status 429;
limit_conn_zone $binary_remote_addr zone=connperip:10m;
limit_conn_status 429;
# rate limiting zones are applied for all servers!
limit_conn connperip 20;
limit_req zone=flood burst=20 nodelay;
#=================================================
I see another related post: 429 too many emoji requests 😥 but so far i don’t see any solution.