The settings of Preview Server can be changed in one of two ways, described below.
Note: Both of these approaches are only available when accessing Preview Server as localhost.
Using the Web Interface
Navigate to <hostname>:21098/settings, or click the Settings link on the home page, and change the settings by putting the desired values in the form. You are not required to click a “submit” button, as the settings are automatically updated and saved when you change any settings on this page.
Using the REST API
Fetching Current Settings
You can send a GET request to <hostname>:21098/api/settings to receive a JSON object representing Preview Server’s current settings. Below is an example using PowerShell:
$settings = (Invoke-WebRequest http://localhost:21098/api/settings).Content | ConvertFrom-JsonThis structure returns a PowerShell object:
corsAllowedOrigin : *servicePort : 21098securePort : 4443previewServerLegacyPort : 54000externalBaseUrl :openIdConnectServerUrl :validAudience : api.vizrt.comredraws : 0alwaysRunPreviewScript : FalseadministrationFromLocalhostOnly : TruethumbPrint :logLevel : WarningYou can then make any changes to the settings object, and send it back, for example changing the log level to Info:
$settings.logLevel = "Info"Now the object looks like this:
corsAllowedOrigin : *servicePort : 21098securePort : 4443previewServerLegacyPort : 54000externalBaseUrl :openIdConnectServerUrl :validAudience : api.vizrt.comredraws : 0alwaysRunPreviewScript : FalseadministrationFromLocalhostOnly : TruethumbPrint :logLevel : InfoNow, we can send the updated settings object back to Preview Server.
Updating Settings
To update the settings, send a POST to the same URL with a JSON object representing the desired settings. Below is an example using PowerShell:
Invoke-WebRequest -Method POST http://localhost:21098/api/settings -Body "$($settings | ConvertTo-Json)" -ContentType "application/json"Returns a response like this:
StatusCode : 200StatusDescription : OKContent : {}RawContent : HTTP/1.1 200 OK Content-Length: 0 Date: Mon, 24 Mar 2025 12:45:16 GMT Server: KestrelHeaders : {[Content-Length, 0], [Date, Mon, 24 Mar 2025 12:45:16 GMT], [Server, Kestrel]}RawContentLength : 0You can verify the setting was changed by fetching the setting again, as described above.
You can also change the settings by specifying the settings you want to change, for example to change the log level back to Warning:
Invoke-WebRequest -Method POST http://localhost:21098/api/settings -Body '{"logLevel": "Warning"}' -ContentType "application/json"Settings that Require a Restart
The settings exposed in the web interface do not require a restart of Preview Server to take effect. Below is a list of settings that do require a restart before they take effect:
corsAllowedOriginservicePortsecurePortpreviewServerLegacyPortexternalBaseUrlopenIdConnectServerUrlvalidAudienceadministrationFromLocalhostOnlythumbPrint