1 = Frequently Asked Questions about Unicorn
3 === Why are my redirects going to "http" URLs when my site uses https?
5 If your site is entirely behind https, then Rack applications that use
6 "rack.url_scheme" can set the following in the Unicorn config file:
8 HttpRequest::DEFAULTS["rack.url_scheme"] = "https"
10 Otherwise, you can configure your proxy (nginx) to send the
11 "X-Forwarded-Proto: https" header only for parts of the site that use
12 https. For nginx, you can do it with the following line in appropriate
13 "location" blocks of your nginx config file:
15 proxy_set_header X-Forwarded-Proto https;
17 === Why are log messages from Unicorn are unformatted when using Rails?
19 Current versions of Rails unfortunately overrides the default Logger
22 You can undo this behavior with the default logger in your Unicorn
25 Configurator::DEFAULTS[:logger].formatter = Logger::Formatter.new
27 Of course you can specify an entirely different logger as well
28 with the "logger" directive described by Unicorn::Configurator.
30 === Why am I getting "connection refused"/502 errors under high load?
32 Short answer: your application cannot keep up.
34 You can increase the size of the :backlog parameter if your kernel
35 supports a larger listen() queue, but keep in mind having a large listen
36 queue makes failover to a different machine more difficult.
38 See the TUNING and Unicorn::Configurator documents for more information
39 on :backlog-related topics.