Forums

Unfortunately no one can be told what FluxBB is - you have to see it for yourself.

You are not logged in.

#1 2011-02-14 19:59:35

orkneywd
Member
Registered: 2008-05-10
Posts: 153
Website

_Track Cookie & Nginx Issue

Running 1.4.2 I ran into an issue to do with the cookie "pun_cookie_df7ad8_track".

The error log showed:

2011/02/14 17:37:22 [error] 13968#0: *1346 upstream sent too big header while reading response header from upstream, client: xx.xxx.xx.xxx, server: _________.com, request: "GET /viewtopic.php?id=133 HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "_________.com", referrer: "http://_________.com/viewforum.php?id=101"

The browser error was 502 Bad Gateway.

As far as I can tell (and I might be completely wrong) Fluxbb was sending cookie headers that were too large for nginx to handle. When I deleted the _track cookie the problem was resolved, but having spent another 10 minutes or so testing my board I've noticed that the cookie value is again getting awfully large so it'll throw the same error again shortly.

I believe the error is specific to nginx, caused by its default 4k limit on headers.

This is something I can resolve on the server by upping the limit, but as this could be effecting forum users elsewhere (wherever nginx is being used) I thought I'd throw a note up here incase a fix is somehow possible within the fluxbb core.

If you need any more info just let me know.

(Posted in Discussion as this isn't a FluxBB bug. Feel free to move to any other forum.)

Last edited by orkneywd (2011-02-14 20:00:21)

Offline

#2 2011-02-14 20:57:58

Garciat
Member
From: Santa Cruz, Bolivia
Registered: 2008-10-26
Posts: 109
Website

Re: _Track Cookie & Nginx Issue

The problem is that the viewed topics tracker function (https://github.com/fluxbb/fluxbb/blob/m … s.php#L556) stores the data directly in the cookie. I'd use PHP's $_SESSION magic variable instead.

Last edited by Garciat (2011-02-14 20:58:18)

Offline

#3 2011-02-14 23:44:42

Reines
Administrator
From: Scotland
Registered: 2008-05-11
Posts: 3,197
Website

Re: _Track Cookie & Nginx Issue

FluxBB currently tries to limit this cookie to 4k, but I get the feeling it is maybe slipping slightly over by a few bytes, causing the problem. The other option is if nginx limits the entire headers to 4k, then we need to make a guestimate at the size of the other headers, and limit the cookie appropriately.

I've made a ticket to look into this: https://fluxbb.org/development/core/tickets/294/

Offline

#4 2011-02-15 00:17:36

FSX
Former Developer
From: NL
Registered: 2008-05-09
Posts: 818
Website

Re: _Track Cookie & Nginx Issue

I'm haven't tested this, but you can adjust the client_header_buffer_size configuration value in Nginx. In the docs it says the limit is 1k.

Offline

#5 2011-03-09 13:43:47

Franz
Lead developer
From: Germany
Registered: 2008-05-13
Posts: 6,737
Website

Re: _Track Cookie & Nginx Issue

@orkneywd: I uploaded a patch.
Could you check whether this fixes the issue, please?


fluxbb.de | develoPHP

"As code is more often read than written it's really important to write clean code."

Offline

Board footer

Powered by FluxBB