# Discourse eingebettet: äußere Nginx-Ratenbegrenzung beim Öffnen von Emoticons

**URL:** <https://meta.discourse.org/t/discourse-socketed-outer-nginx-rate-limiting-when-opening-emoticons/96417>\
**Category:** Self-hosting\
**Created:** [5. September 2018 um 15:15 UTC](https://meta.discourse.org/t/discourse-socketed-outer-nginx-rate-limiting-when-opening-emoticons/96417 "2018-09-05T15:15:17Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![TheBestPessimist](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/thebestpessimist/32/247704_2.png) [@TheBestPessimist](https://meta.discourse.org/u/TheBestPessimist)\
**Post date:** [5. September 2018 um 15:15 UTC](https://meta.discourse.org/t/discourse-socketed-outer-nginx-rate-limiting-when-opening-emoticons/96417/1 "2018-09-05T15:15:18Z")

</div>

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:

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/7/b7a43fcd2ac8906454e8e614cb1186fff801a9fb.jpeg)

```plaintext
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](http://nginx.org/en/docs/http/ngx_http_limit_req_module.html#limit_req) can be placed in `http`.

Did i miss anything by any chance?

This is my rate-limiting config placed in `http` _context_:

```plaintext
#=================================================
# 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 😥](https://meta.discourse.org/t/429-too-many-emoji-requests/76561) but so far i don’t see any solution.

---

_[View the full topic](https://meta.discourse.org/t/discourse-socketed-outer-nginx-rate-limiting-when-opening-emoticons/96417)._
