> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/web/webviewer-server/wv-server-config.md).

# Explore WebViewer Server Configuration Options

Explore all WebViewer Server configuration options in this comprehensive guide. Learn how to customize settings within the docker-compose.yml file for optimal web performance. The Apryse Web SDK strea

In this document you will find all available WebViewer Server configuration options. All the options here are configured within the `docker-compose.yml` file. For more information on `docker-compose`, visit the Docker [website](https://docs.docker.com/compose/).

{% hint style="warning" %}
**Setting docker variables**

When modifying Docker arguments and environment variables, booleans must be surrounded by single quotes, in this manner: **'true'** or **'false'**
{% endhint %}

## Configuration for WebViewer

There are some options for the server which must be done before requesting a document render on WebViewer Side. For example

* [CADConvert Options](#cad-convert-options)
* [Office Options](#office-options)
* [Rasterizer Options](#rasterizer-options)

### CAD Convert Options

**Requires WebViewer >=10.1 and WebViewer Server >=2.1.3**

CAD convert options are responsible for controlling how WebViewer Server renders AutoCAD documents. See detailed [API for usage](https://sdk.apryse.com/api/web/Core.PDFNet.Convert.CADConvertOptions.html). These options can be passed into the `loadDocument` call after WebViewer initialization. These settings will be considered when caching the document.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({ webviewerServerUrl }).then((instance) => {
  const cadOpts = new instance.Core.PDFNet.Convert.CADConvertOptions();
  // instance.Core.PDFNet.Convert.createCADConvertOptions().then((opts) => ...)
  cadOpts.setBackgroundColor({R: 255, G: 0, B: 0});
  instance.UI.loadDocument(mydoc, { cadOptions: cadOpts });
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Office Options

Office options are responsible for controlling how WebViewer Server renders Microsoft Office document formats. These options can be passed into the `loadDocument` call after WebViewer initialization. These settings will be considered when caching the document.

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({ webviewerServerURL }).then((instance) => {
  instance.UI.loadDocument(mydoc, { officeOptions: { formatOptions: {
    ApplyPageBreaksToSheet: true
  } } });
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Rasterizer Options

**Requires WebViewer >=10.1 and WebViewer Server >=2.1.3**

Rasterizer options are responsible for changing how WebViewer displays documents and how WebViewer generates some output artifacts on initial load. In order to use them with WebViewer Server, you should set them on the loadDocument call instead of using `updateRasterizerOptions`.

Find more on our [API docs covering rasterizer options](https://sdk.apryse.com/api/web/Core.Document.html#updateRasterizerOptions).

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer({ webviewerServerURL }).then((instance) => {
  const { documentViewer } = instance.Core;
  instance.UI.loadDocument(file, {rasterizerOptions: {'colorPostProcessMode': 1}});
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

## Server configuration

The options here can be configured by restarting the container with any changes. This can be done by restarting the container through `docker-compose restart`.

Server configuration is most easily done via `docker-compose.yml`, located in the root of the WebViewer Server zip. The configuration is handled through environment variables set in the container.

If you are using the containers **without**`docker-compose` you can pass these variables through `-e`[environment flags to docker directly](https://docs.docker.com/engine/reference/commandline/run/#usage).

If you are using our `Windows` installer, see related guides for the [process for setting these variables](/web/webviewer-server/deployment/wv-server-deploying-without-docker.md#configuring-the-server).

All possible variables for WebViewer Server are as follows:

[General Options](#general-options)

* [TRN\_PDFNET\_KEY](#add-your-pdfnet-key)
* [INCLUDE\_DEMO](#webviewer-server-demo)
* [URL\_PREFIX](#customize-server-url)
* [TRN\_MAX\_CACHED\_MB](#configuring-the-maximum-size-of-the-local-disk-cache)
* [TRN\_MAX\_CACHE\_AGE\_MINUTES](#configuring-the-maximum-age-of-the-local-disk-cache)
* [TRN\_MAX\_MEMORY\_CACHE\_AGE\_MINUTES](#configuring-the-maximum-age-of-the-local-memory-cache)
* [TRN\_FORCE\_LOSSLESS\_IMAGES](#force-lossless-images)
* [TRN\_DISABLE\_CLIENT\_SIDE\_RENDERING](#disable-client-side-rendering)
* [TRN\_MAX\_EXCEL\_CELL\_COUNT](#max-excel-cell-count)
* [TRN\_USE\_OFFICE\_CONVERSION](#office-conversion-backend)
* [TRN\_CAD\_XREF\_CONFIG\_URL](#cad-xref-config)
* [TRN\_INTERNAL\_DATA\_DIR](#change-the-internal-data-directory)
* [TRN\_DATA\_STORAGE\_DIR](#change-the-http-data-directory)
* [TRN\_DISABLE\_WATCHDOG\_RESTART](#disable-the-watchdog-auto-restart)
* [TRN\_HEALTH\_FAILURE\_CODE](#health-failure-code)
* [TRN\_SET\_LOCALE](#set-the-default-office-locale)
* [TRN\_RUNNING\_PORT\_NUM](#changing-the-bound-port)
* [TRN\_LOCALHOST\_URL](#changing-the-localhost-url)
* [TRN\_TEXTEXT\_EX\_USING\_ZORDER](#using-zorder-for-text)
* [TRN\_ENABLE\_PROMETHEUS](#using-prometheus-with-the-server)
* [TRN\_BIN\_DIR](#change-where-the-server-looks-for-its-binaries)
* [TC\_TARGET\_PATH](#change-where-the-server-looks-for-its-java-jar-files)
* [TRN\_HTTP\_PORT](#setting-the-http-port)
* [TRN\_HTTPS\_PORT](#setting-the-https-port)
* [TRN\_SSLCERT\_PATH](#changing-the-default-ssl-certificate-location)
* [TRN\_SSLCERTKEY\_PATH](#changing-the-default-ssl-certificate-private-key-location)

[Security Options](#security-options)

* [TRN\_FETCH\_TIMEOUT\_MS](#fetch-timeout)
* [TRN\_HTML2PDF\_TIMEOUT](#html2pdf-timeout)
* [TRN\_FETCH\_DEFAULT\_BASE\_ADDR](#relative-url)
* [TRN\_FETCH\_REQUIRED\_URL\_ROOTS](#url-root-restriction)
* [TRN\_FORWARD\_CLIENT\_COOKIES](#same-domain-cookie-forwarding)
* [TRN\_FORCE\_URL\_RECHECK](#force-url-rechecking)
* [TRN\_ALLOWED\_ORIGINS](#restrict-client-origins)
* [TRN\_DISABLE\_CLIENT\_PDF\_ACCESS](#disable-client-side-pdf-access)
* [TRN\_ENABLE\_SESSION\_AUTH](#access-control)
* [TRN\_ENABLE\_PER\_SESSION\_CACHING](#session-caching)
* [TRN\_DISABLE\_VALIDATION](#disable-fetch-validation)
* [TRN\_STRIP\_URLS](#strip-urls-from-logs)
* [TRN\_SECURE\_LOGS](#strip-urls-from-logs)
* [TRN\_BLOCKED\_DOMAINS](#blocked-domains-for-file-fetches)
* [TRN\_ALLOWED\_DOMAINS](#whitelist-domains-for-file-fetches)
* [TRN\_DISABLE\_JSESSION](#disable-jsession)
* [SHOULD\_HIDE\_PRODUCT\_KEY](#hide-product-key-in-logs)

[Deployment Options](#deployment-options)

* [TRN\_BALANCER\_COOKIE\_NAME](#client-stickiness-refresh)
* [TRN\_FORCE\_READABLE\_TIMESTAMPS](#readable-timestamps-on-windows-webViewer-server)

[Debug Options](#debug-options)

* [AWS\_ERROR\_REPORTING](#enable-aws-crash-collection)
* [TRN\_FETCH\_DOWNGRADE\_HTTPS](#disable-https)
* [TRN\_DEBUG\_DISABLE\_CLIENT\_BACKEND\_SWITCH](#disable-backend-switch)
* [TRN\_DEBUG\_MODE](#debug-mode)
* [TRN\_LOG\_LEVEL](#configuring-log-levels)
* [TRN\_LOG\_LOCATION](#configuring-log-location)

## General Options

### Add Your PDFNet Key

To add your PDFNet key to the WebViewer Server the key must be set on the `TRN_PDFNET_KEY` option in `docker-compose.yml` (you do not need to set this property if you are demoing our software). This key must also be set in your WebViewer client constructor. This [guide](/web/what-is-webviewer/deployment-options.md#client-only) details how to add a license key to the constructor.

### WebViewer Server Demo

WebViewer server comes with a demo that can be used for testing and debugging purposes. To remove this demo from the container set `INCLUDE_DEMO` to `false`. If not set to false, the demo is accessible at http\://\<HOST\_IP\_ADDRESS or localhost>:8090/demo?s

### Customize server URL

To access the server from a different internal URL, adjust the `URL_PREFIX` options in `docker-compose.yml`. For example, with the option value `URL_PREFIX: custom-prefix`, the demo would be available at http\://\<HOST\_IP\_ADDRESS or localhost>:8090/custom-prefix/demo/?s

### Configuring the maximum size of the local disk cache

`TRN_MAX_CACHED_MB` to configure the maximum size of the local disk cache before a cache deletion will occur. This should be set to 10% lower than the available space to WebViewer Server. Accepts a number in megabytes. Defaults to 10GB if not set. Has a minimum value of 1 GB. If set to -1, cache will not be cleaned unless total disk space is less than 1 GB. Refer to this guide for more info about cache [interactions](/web/webviewer-server/wv-server-hardware-and-network.md#using-the-on-disk-cache)

**We do not suggest setting this higher than 100GB as this can lead to excessive clean-up times**

### Configuring the maximum age of the local disk cache

`TRN_MAX_CACHE_AGE_MINUTES` determines how long the local disk cache will be kept before deletion. It accepts a number in minutes for deletion time with a minimum of 1 minute and a default of 30 minutes. Refer to this guide for more info about cache [interactions](/web/webviewer-server/wv-server-hardware-and-network.md#using-the-on-disk-cache).

### Configuring the maximum age of the local memory cache

`TRN_MAX_MEMORY_CACHE_AGE_MINUTES` determines how long the local document will be kept in the in-memory cache before deletion. Setting this lower or higher will decrease or increase the speed at which your server uses memory. Setting this does not effect the disk cache. It accepts a number in minutes for deletion time with a minimum of 1 minute and a default of 1 minute. Refer to this guide for more info about cache [interactions](/web/webviewer-server/wv-server-hardware-and-network.md#using-the-on-disk-cache).

This should only be altered if you wish to increase memory usage or lower it. While the in memory cache can be deleted, a disk cache may still be available.

### Force lossless images

Setting the environment variable `TRN_FORCE_LOSSLESS_IMAGES` to `true` will force the server to use lossless images when creating PDF image tiles. This option is required if performing differential layering with the WebViewer client to avoid image artifacts when highlighting document differences.

### Disable client side rendering

Setting the environment variable `TRN_DISABLE_CLIENT_SIDE_RENDERING` to `true` in the server container will cause webviewer to stick with the server-rendering image backend and not switch to a more efficient client side option at any point. This option will create a greater load on the server.

### Max Excel Cell Count

`TRN_MAX_EXCEL_CELL_COUNT` sets the upper limit for maximum unique cell count on an excel document. If a document sent to the server exceeds this cell count, the server will reject it.

Sometimes excel file's unique cell counts can exceed the millions and consume large amounts of memory. This option offers a way to prevent excessive memory usage on the server when processing excel documents of an unknown size. Their exact relation between memory and unique cells is as follows:

100,000 unique cells within an excel document = 400 MB of memory consumption during initial document processing

### Office Conversion Backend

`TRN_USE_OFFICE_CONVERSION` is a boolean to specify which backend to use for conversion of rtf and msg files. When set to true, it will use the PDFNetSDK license required. If set to false, it will use the included Leadtools conversion.

### CAD XRef Config

`TRN_CAD_XREF_CONFIG_URL` allows for supporting external references inside of CAD files. Should be set to a server which returns JSON containing the location of the external files on the local WebViewer Server system. For more information, please refer to our [FAQ on XRefs](/web/get-started/faq/supporting-xrefs.md).

### Change the internal data directory

**This should not be changed unless absolutely required**

`TRN_INTERNAL_DATA_DIR` sets the internal data directory for WebViewer Server. WebViewer Server must have access to this directory in order to function. This directory stores some log data and various operation files.

### Change the HTTP data directory

**This should not be changed unless absolutely required**

`TRN_DATA_STORAGE_DIR` sets the HTTP data directory for WebViewer Server. WebViewer Server must have access to this directory in order to function. This directory stores all completed and processed documents. For more detailed information on setting this option visit our [FAQ](/web/get-started/faq/changing-the-http-data-directory.md).

### Disable the Watchdog Auto Restart

When `TRN_DISABLE_WATCHDOG_RESTART` is set to 'true' WebViewer Server will no longer attempt to auto restart itself after a crash. If enabling this, ensure your deployment system manages restarts based on container health or system status.

### Health Failure Code

WebViewer Server returns a 500 HTTP error when a health check is failed. Setting `TRN_HEALTH_FAILURE_CODE` to an HTTP code will change what WebViewer Server responds with when a health check is failed.

### Set the Default Office Locale

WebViewer Server allows setting language locales for office document conversions. To do so, set `TRN_SET_LOCALE` to a [locale code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes). Currently Arabic, Chinese, Dutch, English, French, German, Hebrew, Hindi, Japanese, Korean, Portuguese, Russian and Spanish are supported.

This will change how things like dates are ordered among other locale specific data.

It is also possible to set a per document locale when calling loadDocument from WebViewer, the following example shows how this can be done.

In WebViewer 8.3

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer(
  {
    path: '../../../lib',
    webviewerServerURL: 'https://demo.apryse.com/',
  },
  document.getElementById('viewer')
).then((instance) => {
    instance.UI.loadDocument(url, {officeOptions: formatOptions: { locale: 'de-DE'}}); // sets it to the German locale
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

In WebViewer < 8.3

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
WebViewer(
  {
    path: '../../../lib',
    webviewerServerURL: 'https://demo.apryse.com/',
  },
  document.getElementById('viewer')
).then((instance) => {
    instance.UI.loadDocument(url, {officeLocale: 'de-DE'}); // sets it to the German locale
})
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Changing the localhost URL

If your environment happens to alter how localhost binding generally works this can cause the server's internal health check to fail, which relies on a localhost URL request. By default this value is set to 0.0.0.0. Changing this value may fix issues where the healthcheck is failing with 403 or 404 errors in your server logs.

### Using z-order for text

**Requires WebViewer >= 10.7 and WebViewer Server >= 2.2.0**

`TRN_TEXTEXT_EX_USING_ZORDER` set to `true` to use z-order (aka paint order) as the reading order for text.

### Using Prometheus with the server

[Prometheus](https://prometheus.io/) is a metricChanging the bound port

If you change your port bound on Tomcat from 8090 to another port, you should also set TRN\_RUNNING\_PORT\_NUM to the value you have set it to. This should only be done when using the Windows installer and changing the Tomcat port normally via the tomcat apache-tomcat/conf/server.xml. If not done, the health check will fail. monitoring tool which WebViewer Server now supports an integration with. This integration can be enabled by setting `TRN_ENABLE_PROMETHEUS` to `true`. The metrics enabled by this option will be available at `domain/blackbox/metrics` and will return Prometheus formatted text data. This API can be put into your Prometheus server as a [target](https://prometheus.io/docs/prometheus/latest/getting_started/). The server will return the following information to Prometheus, with the first value being the metric name and the values after being the key types for this metric.Changing the bound port

If you change your port bound on Tomcat from 8090 to another port, you should also set TRN\_RUNNING\_PORT\_NUM to the value you have set it to. This should only be done when using the Windows installer and changing the Tomcat port normally via the tomcat apache-tomcat/conf/server.xml. If not done, the health check will fail.

* Base server information: `software_info - id, os_version, main_thread_pool_size`
* Hardware information: `hardware_info - num_cpu_cores, total_memory`
* Version information: `version_info - wvs_version, build_version`
* CPU usage: `cpu_usage_percent`
* Memory usage: `mem_free_mb`
* Internal job queue sizes: `queue_sizes - queue_types (main, convert and fetch queue)`
* Internal job queue delays for each of the 5 timing windows: `queue_delay_times - window (50ms, 2000ms, 5000ms, 30000ms, 60000ms)`
* How health checks are responding determined from an internal perspective: `health_responses`

The API will still be available with this set to `false` but will not collect metric data.

### Setting the HTTP port

`TRN_HTTP_PORT` can be set to a valid port number, set to `8090` by default. This controls what HTTP port Tomcat binds the server to. This will likely only be modified in a Windows environment where you need to modify the ports directly.

### Setting the HTTPS port

`TRN_HTTPS_PORT` can be set to a valid port number, set to `8443` by default. This controls what HTTPS port Tomcat binds the server to. This will likely only be modified in a Windows environment where you need to modify the ports directly.

### Changing the default SSL certificate location

By default a self signed certificate for HTTPS is included with the server under `libs/ssl` - the argument `TRN_SSLCERT_PATH` changes where it looks for this certificate if you wish to include your own.

### Changing the default SSL certificate private key location

By default a self signed certificate private key for HTTPS is included with the server under `libs/ssl` - the argument `TRN_SSLCERTKEY_PATH` changes where it looks for this certificate if you wish to include your own.

## Security Options

### Fetch Timeout

If the server has the environment variable `TRN_FETCH_TIMEOUT_MS` set, the server will set the timeout to the value specified in milliseconds. This value is the time it takes before a timeout occurs when opening a connection and when waiting for the first byte of a requested file. The default value is `20000` milliseconds.

### HTML2PDF Timeout

HTML2PDF conversions have a seperate timeout controlled by `TRN_HTML2PDF_TIMEOUT` defined in milliseconds. This defaults to `300000` milliseconds (5 minutes). This effects conversions for `.eml.msg.html.url` files.

### Relative URL

If the server container has the environment variable `TRN_FETCH_DEFAULT_BASE_ADDR` set, any incoming URL to the server will be `TRN_FETCH_DEFAULT_BASE_ADDR` + the incoming url when the server attempts to fetch it.

### URL root restriction

If the server container has the environment variable `TRN_FETCH_REQUIRED_URL_ROOTS` set, then each URL will be checked against its value before initiating any fetch routine. You may specify more than one possible URL root by seperating addresses with semicolons:

`TRN_FETCH_REQUIRED_URL_ROOTS`: `www.test.com;www.pdftron.com;www.google.com`

This check is done after any URL alteration performed due to the above `TRN_FETCH_DEFAULT_BASE_ADDR` option. For example, if `TRN_FETCH_REQUIRED_URL_ROOTS == my.domain.com/subpath`, then the document `http://my.domain.com/subpath/doc.pdf` would be be allowed, but both `http://my.domain.com/doc.pdf` and `http://my.other.domain.com/subpath/doc.pdf` would fail. The protocol is not part of this check, and will be ignored if it is included in `TRN_FETCH_REQUIRED_URL_ROOTS`.

### Same domain cookie forwarding

If the server container has specified `TRN_FORWARD_CLIENT_COOKIES` as `true`, cookies a client has received from another server on the same domain will be shared with the WebViewer Server. This can allow cookie based authorization schemes to pass their cookies for the server to use.

### Force URL Rechecking

`TRN_FORCE_URL_RECHECK` should be set to `true` if you want to check the accessiblity of a document's original url whenever performing an action with this document. This ensures the document is still accessible to the user requesting it, preventing them from gaining access to documents that may have expired.

### Restrict client origins

`TRN_ALLOWED_ORIGINS` should be set to the origin of the site your clients will be accessing WebViewer from. This will ensure WebViewer Server will only accept requests from that site. If this option is not defined, no connections will be accepted.

This option can be passed domains seperated by a comma. You may use the wildcards `*` to represent multiple (0 or more) wildcard characters and `?` to represent a single (0 or more) wildcard character.

`TRN_ALLOWED_ORIGINS: https://pdftron.com,https://amazon.com`

With wildcards

`TRN_ALLOWED_ORIGINS: *//pdftron.com,https://amazon.*`

### Disable client side PDF access

Setting the environment variable `TRN_DISABLE_CLIENT_PDF_ACCESS` to `true` will prevent the server from sending the PDF directly to the client, preferring other display modes instead (like server-side image rendering or .xod). Intended to protect sensitive documents by ensuring that only derived data (like rendered pages) are ever sent to the client.

### Access Control

Locks user document links to user sessions so they are inaccessible to other users with the document link while the original document owner is disconnected. Set `TRN_ENABLE_SESSION_AUTH` to `true` to enable this feature.

During the course of normal operation, WebViewer server will generate static content like rendered pages or document metadata and make it accessible to clients via an obfuscated URI. This link is hashed and obfuscated -- if a client shares or leaks the link, it could be accessible by third parties. By enabling the option, it will ensure that this URL is only accessible to those with the link while the client is actively connected.

It is possible to access the authentication token client side by calling the following API:

{% tabs %}
{% tab title="JavaScript" %}
{% code lineNumbers="true" %}

```js
Webviewer({
  pdftronServer: "http://localhost:8090",
  path: '/lib',
}, document.getElementById('viewer')).then(instance => {
	const { docViewer, annotManager } = instance;
	instance.loadDocument(url);
	docViewer.on("documentLoaded", () => {
		const doc = docViewer.getDocument();
		console.log("the auth id: " + doc.getAuthId());
	});
});
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Session caching

By setting `TRN_ENABLE_PER_SESSION_CACHING` to `true`, cached files will be stored behind a session identifier path on the server. Enable this with `TRN_ENABLE_SESSION_AUTH` for completely user session secure documents. This will prevent the server from allowing clients who request a document, that has already been fetched, from accessing a version cached by a different user. With these features both enabled, most caching will be disabled and the server will take a performance hit.

### Disable fetch validation

`TRN_DISABLE_VALIDATION` should be set to `true` to disable HTTPS link validation. HTTPS link validation is done whenever a file url is passed to WebViewer Server. Enabling this option will leave your system unsecure, but will allow for fetching of file urls with invalid certificates. This should only be used if your setup has been properly secured for this scenario or you are testing the server without public access.

### Strip URLs from logs

`TRN_STRIP_URLS` when set to `true` will remove URL information from fetched links in the server logs. This should only be enabled if you need information security on internal file server fetches.

### Sanitize all user information from logs

`TRN_SECURE_LOGS`\_ \_when set to `true` will remove all user information (URLs, IP addresses, file names, etc.) from both logs and exceptions. It also forcibly sets `TRN_STRIP_URLS` to `true`.

### Block domains for file fetches

`TRN_BLOCKED_DOMAINS` when provided domains will prevent the server from performing file fetches that containing the terms provided in `TRN_BLOCKED_DOMAINS`. These terms should be seperated by a comma (`,`). If the URL that is being fetched contains one of these domains, it will be blocked. You may use the wildcards `*` to represent multiple (0 or more) wildcard characters and `?` to represent a single (0 or more) wildcard character.

{% tabs %}
{% tab title="YAML" %}
{% code lineNumbers="true" %}

```yaml
TRN_BLOCKED_DOMAINS: "google.com,yahoo.com,bing.com, *.my.domain/*"
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Whitelist domains for file fetches

`TRN_ALLOWED_DOMAINS`, when set to a list of domains, will only allow the server to fetch files that match the domains defined in `TRN_ALLOWED_DOMAINS`.

Previously, the default value was a wildcard (`*`) permitting all domains. From **version 3** onward, the default is **empty** (no domains allowed) for improved security. 

Be sure to define at least one allowed domain in your configuration. These terms should be separated by a comma (`,`). The domains included here must include wildcard characters to match anything except a specific file URL. URLs are checked for exact matches when comparing to the whitelist. You may use the wildcards `*` to represent multiple (0 or more) wildcard characters and `?` to represent a single (0 or more) wildcard character.

{% tabs %}
{% tab title="YAML" %}
{% code lineNumbers="true" %}

```yaml
TRN_ALLOWED_DOMAINS: "https://google.com/*,*://yahoo.com/*,bing.com/*, *.my.domain/*,https://myfile.com/test.pdf"`
```

{% endcode %}
{% endtab %}
{% endtabs %}

### Disable JSESSION

`TRN_DISABLE_JSESSION` disables Tomcat's usage of JSESSION. This should not be used with `TRN_ENABLE_AUTH_SESSION`. This should only be used if you find WebViewer Server is overwriting your own JSESSION cookie inside of your environment.

### Hide product key in logs

`SHOULD_HIDE_PRODUCT_KEY` hides the Apryse license key inside of logs if set to `true`

### Change where the server looks for its binaries

`TRN_BIN_DIR` tells WebViewer Server where to look for its expected libraries, these are what execute the internal work of WebViewer Server. By default, this is defined as `../libs`. Do not change this value unless working with an explicitly custom setup.

### Change where the server looks for its Java JAR files

`TC_TARGET_PATH` tells WebViewer Server where to look for its Java libraries, this is by default defined as the `bin` folder. Do not change this value unless working with an explicitly custom setup.

## Deployment Options

### Client stickiness refresh

If running the server in a distributed environment we offer an argument for improving user stickiness when using cookies to manage stickiness. Set `TRN_BALANCER_COOKIE_NAME` to the name of your stickiness cookie. Once set, WebViewer will delete the stickiness cookie whenever opening a new document. This allows users to only be stuck on a particular server on a per document basis.

In order to use this option your environment must allow WebViewer Server to delete cookies server side.

### Readable timestamps on Windows WebViewer Server

**Windows Installer Only**

By default timestamps appear in the UNIX time format. When using Docker this timestamp is automatically converted. To do the same on Windows, you should set the option `TRN_FORCE_READABLE_TIMESTAMPS` to `true`.

## Debug Options

### Disable HTTPS

If the environment variable `TRN_FETCH_DOWNGRADE_HTTPS` is set, then all fetches originating from the docker server will be made as http, rather than https.

### Disable backend switch

If the environment variable `TRN_DEBUG_DISABLE_CLIENT_BACKEND_SWITCH` is set to `true` WebViewer and WebViewer Server will only use image renders of a document. This option can be **very** taxing on the server and will require a far stronger server than WebViewer Server would normally require. **Not recommended for production usage.**

### Debug Mode

If the environment variable `TRN_DEBUG_MODE` is set to `true` WebViewer Server will output more logs than normal and allow the execution of dangerous tasks for debugging purposes.

### Configuring Log Levels

The environment variable `TRN_LOG_LEVEL` can be set to any Log4j2 log level, as defined [here](https://logging.apache.org/log4j/2.x/manual/customloglevels.html). This causes WebViewer Server to only output logs of that level or a level with higher priority. Additionally, a custom log level called `BASIC` has been created between `WARNING` and `ERROR` that only contains important logs. Set `TRN_LOG_LEVEL` to `BASIC` if you want reduced logging.

### Configuring Log Location

The environment variable `TRN_LOG_LOCATION` can be set to change the default folder that WebViewer Server logs output to. This setting can also be present in `wvs_config.json` which takes precedence over the value in the environment variable.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/web/webviewer-server/wv-server-config.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
