- Command-line flags - Direct invocation arguments
- Environment variables - Uppercase flag names with underscores
- Policy files - YAML-based configuration for bot rules and advanced features
Configuration Priority
Settings are applied in this order (highest to lowest priority):- Command-line flags
- Environment variables
- Default values
Core Configuration Flags
Network and Binding
--bind
Environment: BINDDefault:
:8923
Network address for Anubis to listen on.
--bind-network
Environment: BIND_NETWORKDefault:
tcp
Network family to bind to. Accepts any value supported by Go’s net.Listen.
--target
Environment: TARGETDefault:
http://localhost:3923
URL of the service Anubis should protect and proxy to.
Challenge Configuration
--difficulty
Environment: DIFFICULTYDefault:
4
The number of leading zeroes required in proof-of-work challenge responses. Higher values increase difficulty and client computation time.
Metrics and Health Checks
--metrics-bind
Environment: METRICS_BINDDefault:
:9090
Network address for the Prometheus metrics and health check server.
GET /metrics- Prometheus metricsGET /healthz- Health check (returnsOKwhen serving)
--metrics-bind-network
Environment: METRICS_BIND_NETWORKDefault:
tcp
Network family for the metrics server.
Cookie Configuration
--cookie-domain
Environment: COOKIE_DOMAINDefault: unset The domain for which Anubis cookies are valid. Set this to your root domain.
--cookie-dynamic-domain
Environment: COOKIE_DYNAMIC_DOMAINDefault:
false
Automatically set cookie domain based on the request hostname.
--cookie-expiration-time
Environment: COOKIE_EXPIRATION_TIMEDefault:
168h (7 days)
How long challenge pass cookies remain valid.
--cookie-prefix
Environment: COOKIE_PREFIXDefault:
anubis-cookie
Prefix for browser cookies created by Anubis. Useful for avoiding conflicts.
myapp-anubis-authmyapp-anubis-cookie-verification
--cookie-secure
Environment: COOKIE_SECUREDefault:
true
Enable the Secure flag on cookies, requiring HTTPS.
--cookie-same-site
Environment: COOKIE_SAME_SITEDefault:
None
Sets the SameSite attribute for cookies. Valid values: None, Lax, Strict, Default.
COOKIE_SECURE=false, None is automatically downgraded to Lax.
--cookie-partitioned
Environment: COOKIE_PARTITIONEDDefault:
false
Enable the partitioned (CHIPS) flag for iframe isolation.
Policy Files
--policy-fname
Environment: POLICY_FNAMEDefault: Built-in policy Path to the YAML policy file defining bot rules, thresholds, and Open Graph settings.
Logging
--slog-level
Environment: SLOG_LEVELDefault:
INFO
Log level for structured logging. Valid values: DEBUG, INFO, WARN, ERROR.
DEBUG to see detailed request evaluation information.
Signing Keys
--ed25519-private-key-hex
Environment: ED25519_PRIVATE_KEY_HEXDefault: Random (generated at startup) Hex-encoded 64-character ED25519 private key for signing JWTs.
--ed25519-private-key-hex-file
Environment: ED25519_PRIVATE_KEY_HEX_FILEDefault: unset Path to a file containing the hex-encoded ED25519 private key.
--ed25519-private-key-hex or --ed25519-private-key-hex-file may be set.
--hs512-secret
Environment: HS512_SECRETDefault: unset Secret for JWT HS512 algorithm. If set, ED25519 will not be used.
IP Address Detection
--use-remote-address
Environment: USE_REMOTE_ADDRESSDefault:
false
Read the client’s IP from the network socket instead of headers.
--custom-real-ip-header
Environment: CUSTOM_REAL_IP_HEADERDefault: unset Read the client’s real IP from a custom header name.
--xff-strip-private
Environment: XFF_STRIP_PRIVATEDefault:
true
Strip private addresses from X-Forwarded-For headers.
JWT Configuration
--jwt-restriction-header
Environment: JWT_RESTRICTION_HEADERDefault:
X-Real-IP
Restrict JWT validity to match a specific header value (typically client IP).
--difficulty-in-jwt
Environment: DIFFICULTY_IN_JWTDefault:
false
Include the difficulty level in JWT claims for debugging and statistics.
Path Configuration
--base-prefix
Environment: BASE_PREFIXDefault: unset Global path prefix for all Anubis endpoints.
- Challenge page:
/myapp/instead of/ - API endpoints:
/myapp/.within.website/x/anubis/...
--strip-base-prefix
Environment: STRIP_BASE_PREFIXDefault:
false
Remove the base prefix when forwarding requests to the target.
/myapp/api/users → forwarded as /api/users
Redirect Configuration
--redirect-domains
Environment: REDIRECT_DOMAINSDefault: unset (same domain only) Comma-separated list of allowed redirect domains.
--public-url
Environment: PUBLIC_URLDefault: unset Externally accessible URL for this Anubis instance (used for forwardAuth with Traefik).
robots.txt
--serve-robots-txt
Environment: SERVE_ROBOTS_TXTDefault:
false
Serve a default robots.txt that disallows all AI scrapers and bots.
Unix Socket Configuration
--socket-mode
Environment: SOCKET_MODEDefault:
0770
Permissions (mode) for Unix domain sockets.
--bind-network=unix or --metrics-bind-network=unix.
Open Graph Configuration
--og-passthrough
Environment: OG_PASSTHROUGHDefault:
false
Enable Open Graph tag passthrough for social media previews.
Prefer configuring Open Graph in the [policy file](the policy file) for more control.
--og-expiry-time
Environment: OG_EXPIRY_TIMEDefault:
24h
Cache expiration time for Open Graph tags.
--og-cache-consider-host
Environment: OG_CACHE_CONSIDER_HOSTDefault:
false
Include the hostname in Open Graph cache keys.
Advanced Target Configuration
--target-host
Environment: TARGET_HOSTDefault: unset Override the
Host header when forwarding to the target.
--target-sni
Environment: TARGET_SNIDefault: unset TLS SNI hostname when connecting to HTTPS backends.
--target-insecure-skip-verify
Environment: TARGET_INSECURE_SKIP_VERIFYDefault:
false
Skip TLS certificate validation for HTTPS backends.
--target-disable-keepalive
Environment: TARGET_DISABLE_KEEPALIVEDefault:
false
Disable HTTP keep-alive for backend connections.
User Interface Customization
--webmaster-email
Environment: WEBMASTER_EMAILDefault: unset Display a contact email on error pages.
--use-simplified-explanation
Environment: USE_SIMPLIFIED_EXPLANATIONDefault:
false
Use simplified language in “Why am I seeing this?” text for non-technical users.
--forced-language
Environment: FORCED_LANGUAGEDefault: unset Force a specific language instead of using the browser’s
Accept-Language header.
Utility Flags
--version
Environment: N/A
Print Anubis version and exit.
--healthcheck
Environment: N/A
Run a health check against the running Anubis instance.
--extract-resources
Environment: EXTRACT_RESOURCESDefault: unset Extract embedded static resources to a directory.
--debug-benchmark-js
Environment: DEBUG_BENCHMARK_JSDefault:
false
Enable debug mode that shows challenges on every request for testing JavaScript performance.
Configuration via Policy Files
The following settings are configured in the YAML policy file rather than via flags:- Bot detection rules - Define which bots to block, challenge, or allow
- Open Graph passthrough - Advanced social media preview configuration
- Weight thresholds - Custom scoring thresholds for bot detection
Bot Policies
Configure bot detection rules
Policy Configuration
Complete policy file structure
Environment Variable Examples
Next Steps
Bot Policies
Configure bot detection rules
Deployment Guides
Platform-specific setup guides