Server Configuration
This section defines all required settings that are needed to run the Nauthilus server.
Basic Server Settings
server::address
Default: "127.0.0.1:9080"
This is the IPv4 or IPv6 addresses combined with a TCP port.
server:
address: "[::]:9443"
server::max_concurrent_requests
Default: 100
This setting defines the maximum number of concurrent requests that can be processed by the server.
server:
max_concurrent_requests: 200
server::max_password_history_entries
Default: 0
This setting defines the maximum number of password history entries to store for each user.
server:
max_password_history_entries: 10
server::haproxy_v2
Default: false
If this setting is turned on (true), Nauthilus can make use of the HAproxy version 2 protocol header to identify the original client request.
server:
haproxy_v2: true
server::http3
Default: false
Enable HTTP/3 support for the server. There does not exist the PROXY protocol for this version!
server::disabled_endpoints
New in version 1.4.9
Default: All endpoints are enabled
It is possible to disable certain HTTP location endpoints that are not needed.
server:
disabled_endpoints:
auth_header: false
auth_json: false
auth_basic: false
auth_nginx: false
auth_jwt: false
custom_hooks: false
configuration: false # Available from version 1.7.11
Disableing unused endpoints may enhance overall security!
Meaning
| Key-name | location | description |
|---|---|---|
| auth_header | /api/v1/auth/header | Turn off requests based on HTTP headers |
| auth_json | /api/v1/auth/json | Turn off HTTP JSON-POST requests |
| auth_basic | /api/v1/auth/basic | Turn off HTTP Basic Authorization requests (recommended!) |
| auth_nginx | /api/v1/auth/nginx | Turn off Nginx based requests used by the mail plugin of Nginx |
| auth_jwt | /api/v1/jwt/* | Turn off JWT authentication endpoints |
| custom_hooks | /api/v1/custom/* | Turn off all Lua based custom hooks |
| configuration | /api/v1/config/* | Turn off all configuration related endpoints |
Note:
/api/v1/auth/basicis compiled only when the build tagauth_basic_endpointis set.server.disabled_endpoints.auth_basiconly has an effect when that endpoint is present in the binary.
HTTP Client Configuration
server::http_client
Whenever Nauthilus is acting as an HTTP client, a common shared Go-builtin HTTP client is used to handle all requests.
There do exist the following HTTP clients in Nauthilus:
| Scope | Usage |
|---|---|
| oidc | Native Identity Provider (OIDC) client |
| saml | Native Identity Provider (SAML2) client |
| action | Used for Lua actions, if HTTP requests are used |
| filter | Used for Lua filters, if HTTP requests are used |
| feature | Used for Lua featuress, if HTTP requests are used |
| hook | Used for Lua custom hooks, if HTTP requests are used |
Settings are shared with all HTTP clients!
| Setting | Meaning (Used from official Go docs) | Default |
|---|---|---|
| max_connections_per_host | Limits the total number of connections per host, including connections in the dialing, active, and idle states. On limit violation, dials will block. | 0, no limits |
| max_idle_connections | Controls the maximum number of idle (keep-alive) connections across all hosts. | 0, no limits |
| max_idle_connections_per_host | Controls the maximum idle (keep-alive) connections to keep per-host. | 0, no limits |
| idle_connection_timeout | Is the maximum amount of time an idle (keep-alive) connection will remain idle before closing itself. | 0, no limits |
| proxy | HTTP proxy URL to use for client connections. New in version 1.7.11 | "", no proxy |
| tls | TLS configuration for the HTTP client. New in version 1.7.11 | See below |
Units for the timeout option should add a time unit like
- s - seconds
- m - minutes
- h - hours
server:
http_client:
max_connections_per_host: 10
max_idle_connections: 5
max_idle_connections_per_host: 1
idle_connection_timeout: 60s
proxy: "http://proxy.example.com:8080"
tls:
skip_verify: false
Timeouts
New in version 1.10.0
Global, operation-specific timeouts for selected subsystems. Values use Go's duration format (e.g., 500ms, 2s, 1m30s).
server:
timeouts:
redis_read: 1s # Timeout for Redis read operations (GET, HGET, etc.). Default: 1s
redis_write: 2s # Timeout for Redis write operations (SET, HSET, etc.). Default: 2s
ldap_search: 3s # Timeout for LDAP search operations. Default: 3s
ldap_bind: 3s # Timeout for LDAP bind/auth operations. Default: 3s
ldap_modify: 5s # Timeout for LDAP modify operations. Default: 5s
lua_backend: 5s # Timeout for Lua backend operations. Default: 5s
Notes
- These are client-side timeouts applied by Nauthilus when talking to external systems or running local subsystems.
- All fields are optional; if omitted or set to a non-positive duration, the defaults shown above are used.
- Deprecated: As of v1.11.4,
singleflight_workis removed and ignored because in-process deduplication has been withdrawn.
Keys and defaults
- server::timeouts::redis_read — Default: 1s
- server::timeouts::redis_write — Default: 2s
- server::timeouts::ldap_search — Default: 3s
- server::timeouts::ldap_bind — Default: 3s
- server::timeouts::ldap_modify — Default: 5s
- server::timeouts::lua_backend — Default: 5s Deprecated/removed in v1.11.4
- server::timeouts::singleflight_work — Removed. Ignored if present.
HTTP Middlewares
server::middlewares
New in version 1.11.3
Feature switches to enable/disable individual HTTP middlewares. When a key is omitted, it defaults to true to preserve legacy behavior.
Available switches (all default to true):
- server::middlewares::logging — Access and request logging middleware.
- server::middlewares::limit — Request limiting middleware (enforces server::max_concurrent_requests and protects against overload).
- server::middlewares::recovery — Panic recovery middleware; converts panics into 500 responses and logs stack traces.
- server::middlewares::trusted_proxies — Honors X-Forwarded-For / proxy headers from trusted upstreams.
- server::middlewares::request_decompression — Transparently decompresses incoming requests (e.g., gzip) when applicable.
- server::middlewares::response_compression — Compresses HTTP responses when accepted by the client.
- server::middlewares::metrics — Exposes Prometheus-compatible HTTP metrics.
Example
server:
middlewares:
logging: true
limit: true
recovery: true
trusted_proxies: true
request_decompression: true
response_compression: true
metrics: true
Notes
- Omit a key to keep it enabled. Set a key explicitly to false to disable the corresponding middleware.
Request de-duplication
server::dedup
New in version 1.11.0
Controls in-process request de-duplication (singleflight) to collapse identical concurrent work.
In-process deduplication has been removed due to unresolved instability under load. The following keys are deprecated and ignored:
server.dedup.in_process_enabledserver.timeouts.singleflight_work
Keys
- server::dedup::in_process_enabled — Deprecated/ignored since v1.11.4.
- server::dedup::distributed_enabled — Deprecated/ignored. Distributed (Redis-based) deduplication was removed earlier; this flag has no effect.
Example
# Deprecated/ignored since v1.11.4
# server:
# dedup:
# in_process_enabled: true
# # distributed_enabled is deprecated and ignored
TLS Configuration
server::tls
This object defines TLS related settings.
server::tls::enabled
Default: false
This flag turns on (true) TLS support in the server.
server:
tls:
enabled: true
server::tls::cert and server::tls::key
Default: ""
These two settings define a path to an X509 PEM-formatted certificate and key.
server:
tls:
cert: /usr/local/etc/nauthilus/localhost.localdomain.pem
key: /usr/local/etc/nauthilus/localhost.localdomain.key.pem
server::tls::skip_verify
Default: false
New in version 1.7.11
This flag turns on (true) insecure TLS connections by skipping client certificate verification.
server:
tls:
skip_verify: true
server::tls::http_client_skip_verify
Default: false
Deprecated: Use server::http_client::tls::skip_verify instead
This flag turns on (true) insecure TLS connections for HTTP(s) requests that are originating from Nauthilus to some remote.
server:
tls:
http_client_skip_verify: true
server::tls::min_tls_version
Default: "TLS1.2"
New in version 1.7.11
This setting defines the minimum TLS version that the server will accept. Valid values are "TLS1.2" and "TLS1.3".
server:
tls:
min_tls_version: "TLS1.3"
server::tls::ca_file
Default: ""
New in version 1.7.11
This setting defines the path to a CA certificate file in PEM format. This is used to verify client certificates when mutual TLS authentication is enabled.
server:
tls:
ca_file: /usr/local/etc/nauthilus/ca.pem
server::tls::cipher_suites
Default: []
New in version 1.7.11
This setting defines a list of cipher suites that the server will use for TLS connections. If not specified, the default Go cipher suites will be used.
server:
tls:
cipher_suites:
- "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384"
- "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"
- "TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256"
Authentication Configuration
server::basic_auth
This object defines basic authorization settings.
server::basic_auth::enabled
Default: false
This flag turns on (true) Basic Auth support in the server.
server::basic_auth::username and server::basic_auth::password
Default: ""
These settings define a username and its password that is required by HTTP(s) clients to communicate with Nauthilus. The password must be at least 16 characters long and can contain alphanumeric characters and symbols, but no spaces.
server::oidc_auth
This object enables OIDC Bearer token authentication on the backchannel API (/api/v1/* routes). When enabled, the OIDC Bearer middleware validates tokens issued by the built-in IdP (client_credentials flow).
This is independent of idp.oidc.enabled, which controls whether the IdP itself is active.
server::oidc_auth::enabled
Default: false
This flag turns on (true) OIDC Bearer authentication for the backchannel API.
server:
oidc_auth:
enabled: true
Behavior summary:
- Protected
/api/v1/*modules use this middleware and require a Bearer token with scopenauthilus:authenticate. - Missing or invalid Bearer token results in
401 Unauthorized. - Valid token without required scope results in
403 Forbidden. - If
server.basic_auth.enabledandserver.oidc_auth.enabledare bothtrue, both checks apply (Basic Auth and OIDC Bearer). - This setting validates tokens; token issuance is done by the OIDC token endpoint (
/oidc/token).
Custom hooks (/api/v1/custom/*) are handled separately:
- Hooks with no
lua.custom_hooks[].scopesare public. - Hooks with configured
scopesrequire a valid Bearer token carrying at least one configured scope. - If
scopesare configured butserver.oidc_auth.enabledisfalse, those hooks are denied (401 Unauthorized) because no token validator is active.