MyNixOS website logo
option

services.nghttpx.backends.*.params.redirect-if-not-tls

If true, a backend match requires the frontend connection be TLS encrypted. If it is not, nghttpx responds to the request with a 308 status code and https URI the client should use instead in the Location header.

The port number in the redirect URI is 443 by default and can be changed using 'services.nghttpx.redirect-https-port' option.

If at least one backend has "redirect-if-not-tls" set to true, this feature is enabled for all backend servers with the same pattern. It is advised to set "redirect-if-no-tls" parameter to all backends explicitly if this feature is desired.

Please see https://nghttp2.org/documentation/nghttpx.1.html#cmdoption-nghttpx-b for more detail.