Extra settings
custom_settings.yml holds server settings that settings.yml does not cover, such as logging, HTTPS and the port. It sits next to settings.yml (/configs/custom_settings.yml in Docker) and overrides it where both set the same key (Which setting wins). Restart Stirling PDF after editing it.
Logging#
logging:
level:
root: INFOSingle sign-on logging is covered on the OAuth and SAML pages. For other problems, raise one area at a time and set it back afterwards, because debug logging is large and slows the server:
logging:
level:
stirling.software: DEBUG # general problemsPort and session length#
server:
port: 8080
servlet:
session:
timeout: 30mSERVER_PORT=8080
SERVER_SERVLET_SESSION_TIMEOUT=30mBoth values shown are the defaults.
SSL/TLS configuration#
Stirling PDF can serve HTTPS itself from a PKCS12 keystore. In production it is usually simpler to put it behind a reverse proxy that handles HTTPS (see Production checklist).
server:
port: 8443
ssl:
enabled: true
key-store: file:./configs/keystore.p12
key-store-password: your-keystore-password
key-store-type: PKCS12
key-alias: stirlingSERVER_PORT=8443
SERVER_SSL_ENABLED=true
SERVER_SSL_KEYSTORE=file:./configs/keystore.p12
SERVER_SSL_KEYSTOREPASSWORD=your-keystore-password
SERVER_SSL_KEYSTORETYPE=PKCS12
SERVER_SSL_KEYALIAS=stirlingservices:
stirling-pdf:
environment:
SERVER_PORT: 8443
SERVER_SSL_ENABLED: "true"
SERVER_SSL_KEYSTORE: file:./configs/keystore.p12
SERVER_SSL_KEYSTOREPASSWORD: your-keystore-password
SERVER_SSL_KEYSTORETYPE: PKCS12
SERVER_SSL_KEYALIAS: stirlingTo create a self-signed certificate for testing:
keytool -genkeypair -alias stirling -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore configs/keystore.p12 -validity 365Large request headers (HTTP 431)#
If sign-in or single sign-on fails with HTTP 431 Request Header Fields Too Large, raise the header limit and restart:
server:
max-http-request-header-size: 65536SERVER_MAXHTTPREQUESTHEADERSIZE=65536services:
stirling-pdf:
environment:
SERVER_MAXHTTPREQUESTHEADERSIZE: 65536Try 131072 if the error continues.
Serve under a sub-path#
To serve the app at a path such as https://example.com/pdf instead of the domain root, set:
SYSTEM_ROOTURIPATH=/pdfIn Docker, use this variable: the image's health check reads it too. Outside Docker you can instead set server.servlet.context-path: /pdf in custom_settings.yml.
Also set Frontend URL (system.frontendUrl) to the full address, for example https://example.com/pdf, so links in emails, share links and mobile QR codes include the path.
Outgoing HTTP(S) proxy#
To send the server's outgoing requests, such as licence checks, through a proxy, pass the standard Java proxy options. In Docker, use JAVA_CUSTOM_OPTS:
services:
stirling-pdf:
environment:
JAVA_CUSTOM_OPTS: "-Dhttp.proxyHost=proxy.example.com -Dhttp.proxyPort=8888 -Dhttps.proxyHost=proxy.example.com -Dhttps.proxyPort=8888 -Dhttp.nonProxyHosts=localhost|127.*|[::1]|10.*|*.svc|*.cluster.local"When running the JAR, put the same -D options before -jar on the java command line.