2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
nghttpx(1)
|
|
|
|
==========
|
|
|
|
|
|
|
|
SYNOPSIS
|
|
|
|
--------
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
**nghttpx** [OPTIONS]... [<PRIVATE_KEY> <CERT>]
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
-----------
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
A reverse proxy for HTTP/2, HTTP/1 and SPDY.
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
.. describe:: <PRIVATE_KEY>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
|
|
|
|
Set path to server's private key. Required unless :option:`-p`\,
|
|
|
|
:option:`--client` or :option:`\--frontend-no-tls` are given.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
.. describe:: <CERT>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set path to server's certificate. Required unless :option:`-p`\,
|
|
|
|
:option:`--client` or :option:`\--frontend-no-tls` are given.
|
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
OPTIONS
|
|
|
|
-------
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
The options are categorized into several groups.
|
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Connections
|
|
|
|
~~~~~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -b, --backend=<HOST,PORT>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set backend host and port. For HTTP/1 backend, multiple
|
|
|
|
backend addresses are accepted by repeating this option.
|
|
|
|
HTTP/2 backend does not support multiple backend
|
|
|
|
addresses and the first occurrence of this option is
|
2015-02-22 10:02:57 +01:00
|
|
|
used. UNIX domain socket can be specified by prefixing
|
|
|
|
path name with "unix:" (e.g.,
|
2015-02-22 10:10:55 +01:00
|
|
|
unix:/var/run/backend.sock)
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``127.0.0.1,80``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -f, --frontend=<HOST,PORT>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set frontend host and port. If <HOST> is '\*', it
|
2015-02-22 10:02:57 +01:00
|
|
|
assumes all addresses including both IPv4 and IPv6.
|
|
|
|
UNIX domain socket can be specified by prefixing path
|
2015-02-22 10:10:55 +01:00
|
|
|
name with "unix:" (e.g., unix:/var/run/nghttpx.sock)
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``*,3000``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --backlog=<N>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set listen backlog size.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Default: ``512``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --backend-ipv4
|
|
|
|
|
|
|
|
Resolve backend hostname to IPv4 address only.
|
|
|
|
|
|
|
|
.. option:: --backend-ipv6
|
|
|
|
|
|
|
|
Resolve backend hostname to IPv6 address only.
|
|
|
|
|
2014-08-29 17:15:31 +02:00
|
|
|
.. option:: --backend-http-proxy-uri=<URI>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify proxy URI in the form
|
|
|
|
http://[<USER>:<PASS>@]<PROXY>:<PORT>. If a proxy
|
|
|
|
requires authentication, specify <USER> and <PASS>.
|
|
|
|
Note that they must be properly percent-encoded. This
|
|
|
|
proxy is used when the backend connection is HTTP/2.
|
|
|
|
First, make a CONNECT request to the proxy and it
|
|
|
|
connects to the backend on behalf of nghttpx. This
|
|
|
|
forms tunnel. After that, nghttpx performs SSL/TLS
|
|
|
|
handshake with the downstream through the tunnel. The
|
|
|
|
timeouts when connecting and making CONNECT request can
|
|
|
|
be specified by :option:`--backend-read-timeout` and
|
2014-08-29 17:15:31 +02:00
|
|
|
:option:`--backend-write-timeout` options.
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Performance
|
|
|
|
~~~~~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: -n, --workers=<N>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
Set the number of worker threads.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``1``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --read-rate=<SIZE>
|
2014-08-29 17:15:31 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum average read rate on frontend connection.
|
|
|
|
Setting 0 to this option means read rate is unlimited.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-08-29 17:15:31 +02:00
|
|
|
|
|
|
|
.. option:: --read-burst=<SIZE>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum read burst size on frontend connection.
|
|
|
|
Setting 0 to this option means read burst size is
|
|
|
|
unlimited.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-08-29 17:15:31 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --write-rate=<SIZE>
|
2014-08-29 17:15:31 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum average write rate on frontend connection.
|
|
|
|
Setting 0 to this option means write rate is unlimited.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-08-29 17:15:31 +02:00
|
|
|
|
|
|
|
.. option:: --write-burst=<SIZE>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum write burst size on frontend connection.
|
|
|
|
Setting 0 to this option means write burst size is
|
|
|
|
unlimited.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-08-29 17:15:31 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --worker-read-rate=<SIZE>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum average read rate on frontend connection per
|
|
|
|
worker. Setting 0 to this option means read rate is
|
|
|
|
unlimited. Not implemented yet.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --worker-read-burst=<SIZE>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum read burst size on frontend connection per
|
|
|
|
worker. Setting 0 to this option means read burst size
|
|
|
|
is unlimited. Not implemented yet.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --worker-write-rate=<SIZE>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum average write rate on frontend connection
|
|
|
|
per worker. Setting 0 to this option means write rate
|
|
|
|
is unlimited. Not implemented yet.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --worker-write-burst=<SIZE>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum write burst size on frontend connection per
|
|
|
|
worker. Setting 0 to this option means write burst size
|
|
|
|
is unlimited. Not implemented yet.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --worker-frontend-connections=<N>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum number of simultaneous connections frontend
|
|
|
|
accepts. Setting 0 means unlimited.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --backend-http1-connections-per-host=<N>
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum number of backend concurrent HTTP/1
|
|
|
|
connections per host. This option is meaningful when :option:`-s`
|
|
|
|
option is used. To limit the number of connections per
|
|
|
|
frontend for default mode, use
|
2015-01-09 16:37:42 +01:00
|
|
|
:option:`--backend-http1-connections-per-frontend`\.
|
|
|
|
|
|
|
|
Default: ``8``
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --backend-http1-connections-per-frontend=<N>
|
2015-01-06 17:40:55 +01:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum number of backend concurrent HTTP/1
|
|
|
|
connections per frontend. This option is only used for
|
|
|
|
default mode. 0 means unlimited. To limit the number
|
|
|
|
of connections per host for HTTP/2 or SPDY proxy mode
|
|
|
|
(-s option), use :option:`--backend-http1-connections-per-host`\.
|
2015-01-06 17:40:55 +01:00
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
Default: ``0``
|
|
|
|
|
2015-01-11 09:34:43 +01:00
|
|
|
.. option:: --rlimit-nofile=<N>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set maximum number of open files (RLIMIT_NOFILE) to <N>.
|
|
|
|
If 0 is given, nghttpx does not set the limit.
|
2015-01-11 09:34:43 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --backend-request-buffer=<SIZE>
|
|
|
|
|
|
|
|
Set buffer size used to store backend request.
|
|
|
|
|
|
|
|
Default: ``16K``
|
|
|
|
|
|
|
|
.. option:: --backend-response-buffer=<SIZE>
|
|
|
|
|
|
|
|
Set buffer size used to store backend response.
|
|
|
|
|
2015-01-25 13:49:12 +01:00
|
|
|
Default: ``16K``
|
2015-01-15 16:10:16 +01:00
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Timeout
|
|
|
|
~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --frontend-http2-read-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify read timeout for HTTP/2 and SPDY frontend
|
2014-07-08 17:38:43 +02:00
|
|
|
connection.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
Default: ``180s``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --frontend-read-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify read timeout for HTTP/1.1 frontend connection.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
Default: ``180s``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --frontend-write-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify write timeout for all frontend connections.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
Default: ``30s``
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --stream-read-timeout=<DURATION>
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify read timeout for HTTP/2 and SPDY streams. 0
|
|
|
|
means no timeout.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --stream-write-timeout=<DURATION>
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify write timeout for HTTP/2 and SPDY streams. 0
|
|
|
|
means no timeout.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``0``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --backend-read-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
Specify read timeout for backend connection.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
Default: ``180s``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --backend-write-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
Specify write timeout for backend connection.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
Default: ``30s``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --backend-keep-alive-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify keep-alive timeout for backend connection.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
Default: ``2s``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
.. option:: --listener-disable-timeout=<DURATION>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
After accepting connection failed, connection listener
|
2015-01-29 15:29:52 +01:00
|
|
|
is disabled for a given amount of time. Specifying 0
|
2015-01-15 16:10:16 +01:00
|
|
|
disables this feature.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
Default: ``0``
|
|
|
|
|
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
SSL/TLS
|
|
|
|
~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --ciphers=<SUITE>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set allowed cipher list. The format of the string is
|
|
|
|
described in OpenSSL ciphers(1).
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -k, --insecure
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Don't verify backend server's certificate if :option:`-p`\,
|
|
|
|
:option:`--client` or :option:`\--http2-bridge` are given and
|
2014-07-08 17:38:43 +02:00
|
|
|
:option:`--backend-no-tls` is not given.
|
|
|
|
|
|
|
|
.. option:: --cacert=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set path to trusted CA certificate file if :option:`-p`\, :option:`--client`
|
|
|
|
or :option:`--http2-bridge` are given and :option:`\--backend-no-tls` is not
|
|
|
|
given. The file must be in PEM format. It can contain
|
|
|
|
multiple certificates. If the linked OpenSSL is
|
|
|
|
configured to load system wide certificates, they are
|
|
|
|
loaded at startup regardless of this option.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --private-key-passwd-file=<PATH>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Path to file that contains password for the server's
|
|
|
|
private key. If none is given and the private key is
|
|
|
|
password protected it'll be requested interactively.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --subcert=<KEYPATH>:<CERTPATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify additional certificate and private key file.
|
|
|
|
nghttpx will choose certificates based on the hostname
|
|
|
|
indicated by client using TLS SNI extension. This
|
|
|
|
option can be used multiple times.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --backend-tls-sni-field=<HOST>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Explicitly set the content of the TLS SNI extension.
|
|
|
|
This will default to the backend HOST name.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --dh-param-file=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Path to file that contains DH parameters in PEM format.
|
|
|
|
Without this option, DHE cipher suites are not
|
|
|
|
available.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --npn-list=<LIST>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Comma delimited list of ALPN protocol identifier sorted
|
|
|
|
in the order of preference. That means most desirable
|
|
|
|
protocol comes first. This is used in both ALPN and
|
|
|
|
NPN. The parameter must be delimited by a single comma
|
|
|
|
only and any white spaces are treated as a part of
|
|
|
|
protocol string.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-02-22 10:02:57 +01:00
|
|
|
Default: ``h2,h2-16,h2-14,spdy/3.1,http/1.1``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --verify-client
|
|
|
|
|
|
|
|
Require and verify client certificate.
|
|
|
|
|
|
|
|
.. option:: --verify-client-cacert=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Path to file that contains CA certificates to verify
|
|
|
|
client certificate. The file must be in PEM format. It
|
|
|
|
can contain multiple certificates.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --client-private-key-file=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Path to file that contains client private key used in
|
|
|
|
backend client authentication.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --client-cert-file=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Path to file that contains client certificate used in
|
|
|
|
backend client authentication.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --tls-proto-list=<LIST>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Comma delimited list of SSL/TLS protocol to be enabled.
|
|
|
|
The following protocols are available: TLSv1.2, TLSv1.1
|
|
|
|
and TLSv1.0. The name matching is done in
|
|
|
|
case-insensitive manner. The parameter must be
|
|
|
|
delimited by a single comma only and any white spaces
|
|
|
|
are treated as a part of protocol string.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
Default: ``TLSv1.2,TLSv1.1``
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: --tls-ticket-key-file=<PATH>
|
|
|
|
|
|
|
|
Path to file that contains 48 bytes random data to
|
|
|
|
construct TLS session ticket parameters. This options
|
|
|
|
can be used repeatedly to specify multiple ticket
|
|
|
|
parameters. If several files are given, only the first
|
|
|
|
key is used to encrypt TLS session tickets. Other keys
|
|
|
|
are accepted but server will issue new session ticket
|
|
|
|
with first key. This allows session key rotation.
|
|
|
|
Please note that key rotation does not occur
|
|
|
|
automatically. User should rearrange files or change
|
|
|
|
options values and restart nghttpx gracefully. If
|
|
|
|
opening or reading given file fails, all loaded keys are
|
|
|
|
discarded and it is treated as if none of this option is
|
|
|
|
given. If this option is not given or an error occurred
|
|
|
|
while opening or reading a file, key is generated
|
|
|
|
automatically and renewed every 12hrs. At most 2 keys
|
|
|
|
are stored in memory.
|
|
|
|
|
|
|
|
.. option:: --tls-ctx-per-worker
|
|
|
|
|
|
|
|
Create OpenSSL's SSL_CTX per worker, so that no internal
|
|
|
|
locking is required. This may improve scalability with
|
|
|
|
multi threaded configuration. If this option is
|
|
|
|
enabled, session ID is no longer shared accross SSL_CTX
|
|
|
|
objects, which means session ID generated by one worker
|
|
|
|
is not acceptable by another worker. On the other hand,
|
|
|
|
session ticket key is shared across all worker threads.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
HTTP/2 and SPDY
|
|
|
|
~~~~~~~~~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
.. option:: -c, --http2-max-concurrent-streams=<N>
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set the maximum number of the concurrent streams in one
|
|
|
|
HTTP/2 and SPDY session.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``100``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --frontend-http2-window-bits=<N>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Sets the per-stream initial window size of HTTP/2 SPDY
|
|
|
|
frontend connection. For HTTP/2, the size is 2\*\*<N>-1.
|
|
|
|
For SPDY, the size is 2\*\*<N>.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``16``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --frontend-http2-connection-window-bits=<N>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Sets the per-connection window size of HTTP/2 and SPDY
|
|
|
|
frontend connection. For HTTP/2, the size is
|
|
|
|
2**<N>-1. For SPDY, the size is 2\*\*<N>.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``16``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --frontend-no-tls
|
|
|
|
|
|
|
|
Disable SSL/TLS on frontend connections.
|
|
|
|
|
|
|
|
.. option:: --backend-http2-window-bits=<N>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Sets the initial window size of HTTP/2 backend
|
|
|
|
connection to 2\*\*<N>-1.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``16``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --backend-http2-connection-window-bits=<N>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Sets the per-connection window size of HTTP/2 backend
|
|
|
|
connection to 2\*\*<N>-1.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``16``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --backend-no-tls
|
|
|
|
|
|
|
|
Disable SSL/TLS on backend connections.
|
|
|
|
|
|
|
|
.. option:: --http2-no-cookie-crumbling
|
|
|
|
|
|
|
|
Don't crumble cookie header field.
|
|
|
|
|
|
|
|
.. option:: --padding=<N>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Add at most <N> bytes to a HTTP/2 frame payload as
|
|
|
|
padding. Specify 0 to disable padding. This option is
|
|
|
|
meant for debugging purpose and not intended to enhance
|
|
|
|
protocol security.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-02-08 09:48:18 +01:00
|
|
|
.. option:: --no-server-push
|
|
|
|
|
|
|
|
Disable HTTP/2 server push. Server push is only
|
|
|
|
supported by default mode and HTTP/2 frontend. SPDY
|
|
|
|
frontend does not support server push.
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Mode
|
|
|
|
~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. describe:: (default mode)
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
|
|
|
|
Accept HTTP/2, SPDY and HTTP/1.1 over SSL/TLS. If
|
|
|
|
:option:`--frontend-no-tls` is used, accept HTTP/2 and HTTP/1.1.
|
|
|
|
The incoming HTTP/1.1 connection can be upgraded to
|
|
|
|
HTTP/2 through HTTP Upgrade. The protocol to the
|
|
|
|
backend is HTTP/1.1.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -s, --http2-proxy
|
|
|
|
|
|
|
|
Like default mode, but enable secure proxy mode.
|
|
|
|
|
|
|
|
.. option:: --http2-bridge
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Like default mode, but communicate with the backend in
|
|
|
|
HTTP/2 over SSL/TLS. Thus the incoming all connections
|
|
|
|
are converted to HTTP/2 connection and relayed to the
|
|
|
|
backend. See :option:`--backend-http-proxy-uri` option if you are
|
|
|
|
behind the proxy and want to connect to the outside
|
2014-07-08 17:38:43 +02:00
|
|
|
HTTP/2 proxy.
|
|
|
|
|
|
|
|
.. option:: --client
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Accept HTTP/2 and HTTP/1.1 without SSL/TLS. The
|
|
|
|
incoming HTTP/1.1 connection can be upgraded to HTTP/2
|
|
|
|
connection through HTTP Upgrade. The protocol to the
|
|
|
|
backend is HTTP/2. To use nghttpx as a forward proxy,
|
|
|
|
use :option:`-p` option instead.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -p, --client-proxy
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Like :option:`--client` option, but it also requires the request
|
|
|
|
path from frontend must be an absolute URI, suitable for
|
|
|
|
use as a forward proxy.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Logging
|
|
|
|
~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -L, --log-level=<LEVEL>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set the severity level of log output. <LEVEL> must be
|
|
|
|
one of INFO, NOTICE, WARN, ERROR and FATAL.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``NOTICE``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --accesslog-file=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set path to write access log. To reopen file, send USR1
|
|
|
|
signal to nghttpx.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --accesslog-syslog
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Send access log to syslog. If this option is used,
|
|
|
|
:option:`--accesslog-file` option is ignored.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2014-11-24 07:27:41 +01:00
|
|
|
.. option:: --accesslog-format=<FORMAT>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify format string for access log. The default
|
|
|
|
format is combined format. The following variables are
|
|
|
|
available:
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
* $remote_addr: client IP address.
|
|
|
|
* $time_local: local time in Common Log format.
|
|
|
|
* $time_iso8601: local time in ISO 8601 format.
|
|
|
|
* $request: HTTP request line.
|
|
|
|
* $status: HTTP response status code.
|
2015-01-15 16:10:16 +01:00
|
|
|
* $body_bytes_sent: the number of bytes sent to client
|
|
|
|
as response body.
|
|
|
|
* $http_<VAR>: value of HTTP request header <VAR> where
|
|
|
|
'_' in <VAR> is replaced with '-'.
|
2015-01-09 16:37:42 +01:00
|
|
|
* $remote_port: client port.
|
|
|
|
* $server_port: server port.
|
2015-01-15 16:10:16 +01:00
|
|
|
* $request_time: request processing time in seconds with
|
|
|
|
milliseconds resolution.
|
2015-01-09 16:37:42 +01:00
|
|
|
* $pid: PID of the running process.
|
2015-01-15 16:10:16 +01:00
|
|
|
* $alpn: ALPN identifier of the protocol which generates
|
|
|
|
the response. For HTTP/1, ALPN is always http/1.1,
|
|
|
|
regardless of minor version.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
|
|
|
|
Default: ``$remote_addr - - [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent"``
|
2014-11-24 07:27:41 +01:00
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
.. option:: --errorlog-file=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Set path to write error log. To reopen file, send USR1
|
|
|
|
signal to nghttpx.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``/dev/stderr``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --errorlog-syslog
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Send error log to syslog. If this option is used,
|
|
|
|
:option:`--errorlog-file` option is ignored.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --syslog-facility=<FACILITY>
|
|
|
|
|
|
|
|
Set syslog facility to <FACILITY>.
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
Default: ``daemon``
|
|
|
|
|
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
HTTP
|
|
|
|
~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --add-x-forwarded-for
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Append X-Forwarded-For header field to the downstream
|
|
|
|
request.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2014-10-27 16:35:44 +01:00
|
|
|
.. option:: --strip-incoming-x-forwarded-for
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Strip X-Forwarded-For header field from inbound client
|
|
|
|
requests.
|
2014-10-27 16:35:44 +01:00
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
.. option:: --no-via
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Don't append to Via header field. If Via header field
|
|
|
|
is received, it is left unaltered.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2014-08-16 15:54:15 +02:00
|
|
|
.. option:: --no-location-rewrite
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Don't rewrite location header field on :option:`--http2-bridge`\,
|
|
|
|
:option:`--client` and default mode. For :option:`\--http2-proxy` and
|
|
|
|
:option:`--client-proxy` mode, location header field will not be
|
|
|
|
altered regardless of this option.
|
2014-08-16 15:54:15 +02:00
|
|
|
|
2015-02-08 09:48:18 +01:00
|
|
|
.. option:: --no-host-rewrite
|
|
|
|
|
|
|
|
Don't rewrite host and :authority header fields on
|
|
|
|
:option:`--http2-bridge`\, :option:`--client` and default mode. For
|
|
|
|
:option:`--http2-proxy` and :option:`\--client-proxy` mode, these headers
|
|
|
|
will not be altered regardless of this option.
|
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
.. option:: --altsvc=<PROTOID,PORT[,HOST,[ORIGIN]]>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify protocol ID, port, host and origin of
|
|
|
|
alternative service. <HOST> and <ORIGIN> are optional.
|
|
|
|
They are advertised in alt-svc header field or HTTP/2
|
|
|
|
ALTSVC frame. This option can be used multiple times to
|
|
|
|
specify multiple alternative services. Example:
|
|
|
|
:option:`--altsvc`\=h2,443
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --add-response-header=<HEADER>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Specify additional header field to add to response
|
|
|
|
header set. This option just appends header field and
|
|
|
|
won't replace anything already set. This option can be
|
|
|
|
used several times to specify multiple header fields.
|
2015-01-09 16:37:42 +01:00
|
|
|
Example: :option:`--add-response-header`\="foo: bar"
|
2014-07-08 17:38:43 +02:00
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Debug
|
|
|
|
~~~~~
|
2015-01-15 16:10:16 +01:00
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
.. option:: --frontend-http2-dump-request-header=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Dumps request headers received by HTTP/2 frontend to the
|
|
|
|
file denoted in <PATH>. The output is done in HTTP/1
|
|
|
|
header field format and each header block is followed by
|
|
|
|
an empty line. This option is not thread safe and MUST
|
|
|
|
NOT be used with option :option:`-n`\<N>, where <N> >= 2.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --frontend-http2-dump-response-header=<PATH>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Dumps response headers sent from HTTP/2 frontend to the
|
|
|
|
file denoted in <PATH>. The output is done in HTTP/1
|
|
|
|
header field format and each header block is followed by
|
|
|
|
an empty line. This option is not thread safe and MUST
|
|
|
|
NOT be used with option :option:`-n`\<N>, where <N> >= 2.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -o, --frontend-frame-debug
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Print HTTP/2 frames in frontend to stderr. This option
|
|
|
|
is not thread safe and MUST NOT be used with option
|
|
|
|
:option:`-n`\=N, where N >= 2.
|
|
|
|
|
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Process
|
|
|
|
~~~~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -D, --daemon
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Run in a background. If :option:`-D` is used, the current working
|
|
|
|
directory is changed to '*/*'.
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --pid-file=<PATH>
|
|
|
|
|
|
|
|
Set path to save PID of this program.
|
|
|
|
|
|
|
|
.. option:: --user=<USER>
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
Run this program as <USER>. This option is intended to
|
|
|
|
be used to drop root privileges.
|
|
|
|
|
|
|
|
|
2015-02-01 10:33:24 +01:00
|
|
|
Misc
|
|
|
|
~~~~
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: --conf=<PATH>
|
|
|
|
|
|
|
|
Load configuration from <PATH>.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
|
|
|
Default: ``/etc/nghttpx/nghttpx.conf``
|
2014-07-08 17:38:43 +02:00
|
|
|
|
|
|
|
.. option:: -v, --version
|
|
|
|
|
|
|
|
Print version and exit.
|
|
|
|
|
|
|
|
.. option:: -h, --help
|
|
|
|
|
|
|
|
Print this help and exit.
|
|
|
|
|
2015-01-15 16:10:16 +01:00
|
|
|
|
|
|
|
The <SIZE> argument is an integer and an optional unit (e.g., 10K is
|
|
|
|
10 * 1024). Units are K, M and G (powers of 1024).
|
|
|
|
|
2015-01-29 15:29:52 +01:00
|
|
|
The <DURATION> argument is an integer and an optional unit (e.g., 1s
|
|
|
|
is 1 second and 500ms is 500 milliseconds). Units are s or ms. If
|
|
|
|
a unit is omitted, a second is used as unit.
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
FILES
|
|
|
|
-----
|
|
|
|
|
|
|
|
*/etc/nghttpx/nghttpx.conf*
|
|
|
|
The default configuration file path nghttpx searches at startup.
|
|
|
|
The configuration file path can be changed using :option:`--conf`
|
|
|
|
option.
|
|
|
|
|
2015-01-11 09:34:43 +01:00
|
|
|
Those lines which are staring ``#`` are treated as comment.
|
|
|
|
|
|
|
|
The option name in the configuration file is the long command-line
|
|
|
|
option name with leading ``--`` stripped (e.g., ``frontend``). Put
|
|
|
|
``=`` between option name and value. Don't put extra leading or
|
|
|
|
trailing spaces.
|
|
|
|
|
|
|
|
The options which do not take argument in the command-line *take*
|
|
|
|
argument in the configuration file. Specify ``yes`` as an argument
|
|
|
|
(e.g., ``http2-proxy=yes``). If other string is given, it is
|
|
|
|
ignored.
|
|
|
|
|
|
|
|
To specify private key and certificate file which are given as
|
|
|
|
positional arguments in commnad-line, use ``private-key-file`` and
|
|
|
|
``certificate-file``.
|
|
|
|
|
|
|
|
:option:`--conf` option cannot be used in the configuration file and
|
|
|
|
will be ignored if specified.
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
SIGNALS
|
|
|
|
-------
|
|
|
|
|
|
|
|
SIGQUIT
|
|
|
|
Shutdown gracefully. First accept pending connections and stop
|
|
|
|
accepting connection. After all connections are handled, nghttpx
|
|
|
|
exits.
|
|
|
|
|
|
|
|
SIGUSR1
|
|
|
|
Reopen log files.
|
|
|
|
|
|
|
|
SIGUSR2
|
|
|
|
Fork and execute nghttpx. It will execute the binary in the same
|
2015-01-10 09:12:24 +01:00
|
|
|
path with same command-line arguments and environment variables.
|
|
|
|
After new process comes up, sending SIGQUIT to the original process
|
|
|
|
to perform hot swapping.
|
2015-01-09 16:37:42 +01:00
|
|
|
|
2015-02-08 09:48:18 +01:00
|
|
|
SERVER PUSH
|
|
|
|
-----------
|
|
|
|
|
|
|
|
nghttpx supports HTTP/2 server push in default mode. nghttpx looks
|
|
|
|
for Link header field (`RFC 5988
|
2015-02-15 05:07:23 +01:00
|
|
|
<http://tools.ietf.org/html/rfc5988>`_) in response headers from
|
2015-02-08 09:48:18 +01:00
|
|
|
backend server and extracts URI-reference with parameter
|
|
|
|
``rel=preload`` (see `preload
|
|
|
|
<http://w3c.github.io/preload/#interoperability-with-http-link-header>`_)
|
|
|
|
and pushes those URIs to the frontend client. Here is a sample Link
|
|
|
|
header field to initiate server push:
|
|
|
|
|
|
|
|
.. code-block:: http
|
|
|
|
|
|
|
|
Link: </fonts/font.woff>; rel=preload
|
|
|
|
Link: </css/theme.css>; rel=preload
|
|
|
|
|
|
|
|
Currently, the following restrictions are applied for server push:
|
|
|
|
|
|
|
|
1. URI-reference must not contain authority. If it exists, it is not
|
|
|
|
pushed. ``/fonts/font.woff`` and ``css/theme.css`` are eligible to
|
|
|
|
be pushed. ``https://example.org/fonts/font.woff`` and
|
|
|
|
``//example.org/css/theme.css`` are not.
|
|
|
|
|
|
|
|
2. The associated stream must have method "GET" or "POST". The
|
|
|
|
associated stream's status code must be 200.
|
|
|
|
|
|
|
|
These limitations may be loosened in the future release.
|
|
|
|
|
2014-07-08 17:38:43 +02:00
|
|
|
SEE ALSO
|
|
|
|
--------
|
|
|
|
|
2015-01-09 16:37:42 +01:00
|
|
|
:manpage:`nghttp(1)`, :manpage:`nghttpd(1)`, :manpage:`h2load(1)`
|