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_saslauthd: 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_saslauthd | /api/v1/auth/saslauthd | Turn off saslauthd requests used with cyrus-sasl |
| 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 |
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 |
|---|---|
| core | If the Ory hydra frontend is turned on, all admin-API requests are handled by this 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
singleflight_work: 3s # Budget for the leader's work during in-process deduplication. Default: 3s
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.
- singleflight_work caps the time the leader performs a deduplicated operation before giving up; followers will see a cancellation/timeout if this budget is exceeded.
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::singleflight_work — Default: 3s
- server::timeouts::lua_backend — Default: 5s
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::jwt_auth
This object defines JWT (JSON Web Token) authentication settings. JWT authentication provides a more secure and flexible alternative to HTTP Basic Authentication.
When enabled, Nauthilus provides the following JWT endpoints:
- Token Generation:
POST /api/v1/jwt/token- Generate a new JWT token with username and password - Token Refresh:
POST /api/v1/jwt/refresh- Refresh an existing token using a refresh token
JWT tokens include roles that determine what actions the user can perform:
authenticate: This role is needed to perform authentication requests (renamed from "authenticated" in version 1.7.11)user_info: Required to access endpoints withmode=no-authlist_accounts: Required to access endpoints withmode=list-accountssecurity: Access to security-related features like metrics and brute force managementadmin: Full access to all features- Custom roles: Can be defined for your users and used for custom hooks
For multi-instance environments (e.g., behind a load balancer), enable Redis storage for JWT tokens to ensure that tokens generated by one instance can be validated by another instance.
server::jwt_auth::enabled
Default: false
This flag turns on (true) JWT authentication support in the server.
server:
jwt_auth:
enabled: true
server::jwt_auth::secret_key
Default: ""
This setting defines the secret key used for JWT signing. It should be at least 32 characters long and can contain alphanumeric characters and symbols, but no spaces.
server:
jwt_auth:
secret_key: "your-secret-key-at-least-32-characters"
server::jwt_auth::token_expiry
Default: 1h
This setting defines the expiration time for JWT tokens.
server:
jwt_auth:
token_expiry: 2h