Fork me on GitHub
Subscribe 2

Ticket #294 (fixed bug)

_track cookie can be too large for nginx

  • Created: 2011-02-14 23:43:43
  • Reported by: Reines
  • Assigned to: Franz
  • Milestone: 1.4.5
  • Component: code
  • Priority: normal

The _track cookie is limited to ~4096 bytes, but can grow large enough to cause errors on nginx. Either we haven't limiting it properly and it is growing slightly over, or nginx limits all headers rather than just the cookie to 4k.

Ideally we should be storing this data in the database or a cache - but that is a job for FluxBB 2.0. For now we should lower the limit slightly to prevent nginx getting pissed off.



Franz 2011-03-09 13:42:39

  • Uploaded patch 294-tracking-cookie-nginx.patch. (view)

Here's a patch limiting the size of the cookie to 4096-96-256=3744 bytes. No particular reason for this precise number, I thought it sounds nice. There might be some room for sensible enhancements.

Anyways, this needs to be tested. If this doesn't fix the issue mentioned in the post, something else is wrong, I suppose.

Reines 2011-03-11 09:27:50

  • Owner set to Franz.

Franz 2011-03-14 14:58:21

Hi Franz,

I'll apply the patch tomorrow when I'm working on the site again and will let you know how I get on :-)


Franz 2011-03-17 15:54:13

  • Status changed from open to fixed.

Committed the patch in d876741, as it was reported as working.

The specific size limit might be changed again in the future. I asked for some testing help, as I can not test this.

Franz 2011-03-17 15:55:20

Commit d876741 to fluxbb fluxbb-1.4

#294: Limit size of tracking cookie so that there is some more room for headers when using nginx

Franz 2011-03-22 20:10:09

Commit 1209fe3 to fluxbb fluxbb-1.4

#294: Introduce a new constant for limiting the size of the tracking cookie.

The nginx issue appears too seldomly and can be handled with this constant or via the server configuration.

Franz 2011-03-22 20:12:56

I changed this once more in 1209fe3. We now have a constant FORUM_MAX_COOKIE_SIZE which can be used to limit the size of the tracking cookie easily.