unicorn.git  about / heads / tags
Rack HTTP server for Unix and fast clients
blob 4bb6b980e46b54dba0af99c6f2791c7e40e47533 1662 bytes (raw)
$ git show v0.95.0:FAQ	# shows this blob on the CLI

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
 
= Frequently Asked Questions about Unicorn

=== Why are my redirects going to "http" URLs when my site uses https?

If your site is entirely behind https, then Rack applications that use
"rack.url_scheme" can set the following in the Unicorn config file:

  HttpRequest::DEFAULTS["rack.url_scheme"] = "https"

For frameworks that do not use "rack.url_scheme", you can also
try setting one or both of the following:

  HttpRequest::DEFAULTS["HTTPS"] = "on"
  HttpRequest::DEFAULTS["HTTP_X_FORWARDED_PROTO"] = "https"

Otherwise, you can configure your proxy (nginx) to send the
"X-Forwarded-Proto: https" header only for parts of the site that use
https.  For nginx, you can do it with the following line in appropriate
"location" blocks of your nginx config file:

  proxy_set_header X-Forwarded-Proto https;

=== Why are log messages from Unicorn are unformatted when using Rails?

Current versions of Rails unfortunately overrides the default Logger
formatter.

You can undo this behavior with the default logger in your Unicorn
config file:

  Configurator::DEFAULTS[:logger].formatter = Logger::Formatter.new

Of course you can specify an entirely different logger as well
with the "logger" directive described by Unicorn::Configurator.

=== Why am I getting "connection refused"/502 errors under high load?

Short answer: your application cannot keep up.

You can increase the size of the :backlog parameter if your kernel
supports a larger listen() queue, but keep in mind having a large listen
queue makes failover to a different machine more difficult.

See the TUNING and Unicorn::Configurator documents for more information
on :backlog-related topics.

git clone https://yhbt.net/unicorn.git