Hi!
I've updated Sidekiq to the last version and now I got an error when accessing the web interface via Nginx.
When accessing directly via http://127.0.0.1:5000 it works but when I try via Nginx I got this error in Nginx logs (with a 502 bad gateway error) :
2016/09/16 14:11:35 [error] 7475#7475: *90 upstream sent too big header while reading response header from upstream, client: 127.0.0.1, server: , request: "GET /sidekiq/scheduled HTTP/1.1", upstream: "http://127.0.0.1:5000/sidekiq/scheduled", host: "back.local", referrer: "http://back.local/sidekiq/busy"
Thank you!
We're hitting the same issue. it looks like sidekiq web is adding an additional rack.session cookie for each request. After enough requests the header section of the response gets too big for nginx and you get the above message.
Please show how you are initializing Sidekiq::Web. Are you doing anything more than this?
require 'sidekiq/web'
mount Sidekiq::Web => '/sidekiq'
Our invocation looks very similar to that:
require 'sidekiq/pro/web'
...
APPNAME::Application.routes.draw do
...
mount Sidekiq::Web => '/sidekiq'
...
end
I can also reproduce in 'myapp' in this repo.
bundle exec rails server rack.session cookies: curl -vvv -XGET http://localhost:3000/sidekiq/stats 2>&1 | grep 'rack\.session' | wc -lYou should see the number increase each curl invocation.
Reproducing the problem is 90% of the solution so that's hugely useful - thank you!
I've also run into this issue in production. Was able to work around it using this answer:
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
@Mavvie : thanks for the workaround :)
By the way there might be a bug with the trailing slash on the root page : even with the Nginx fix, I get an error without the trailing slash. If I add it manually it works.
/sidekiq => error
/sidekiq/ => works
Fixed in 4.2.2 : https://github.com/mperham/sidekiq/blob/master/Changes.md#422
Thank you so much, I had this bug for around 1 year 馃拑
Most helpful comment
Fixed in 4.2.2 : https://github.com/mperham/sidekiq/blob/master/Changes.md#422