Configuration Settings

Configuration can be done either by using a configuration file or with environnement variable.

Except stated otherwise, the rule for environnement variable names is QGSWPS_<SECTION>_<KEY> all in uppercase.

Common Configuration Options

SERVER_HTTP_PORT

Port to listen to

Type:

int

Default:

8080

Section:

server

Key:

port

Env:

QGSWPS_SERVER_HTTP_PORT

SERVER_INTERFACES

Interfaces to listen to

Type:

string

Default:

0.0.0.0

Section:

server

Key:

interfaces

Env:

QGSWPS_SERVER_INTERFACES

SERVER_ENABLE_FILTERS

Enable filters as python extension

Type:

boolean

Default:

yes

Section:

server

Key:

enable_filters

Env:

QGSWPS_SERVER_ENABLE_FILTERS

SERVER_HTTP_PROXY

Indicates that the server is behind a reverse proxy. Set this to ‘yes’ if you are planning to use Forwarded Headers or set a static proxy url with QGIS_SERVER_<SERVICE>_URL

Type:

boolean

Default:

no

Section:

server

Key:

http_proxy

Env:

QGSWPS_SERVER_HTTP_PROXY

SERVER_PROXY_URL

The url that must be seen by the client when the server is behind a proxy. Note that this option will be overridden by QGIS_SERVER_<SERVICE>_URL or by X-Qgis-<service>-Url headers.

Type:

string

Section:

server

Key:

proxy_url

Env:

QGSWPS_SERVER_PROXY_URL

SERVER_OUTPUTFILE_AS_REFERENCE

Select if output files are returned by reference for deferred download or in response body as complex output.

Type:

boolean

Default:

no

Section:

server

Key:

outputfile_as_reference

Env:

QGSWPS_SERVER_OUTPUTFILE_AS_REFERENCE

SERVER_MAXINPUTSIZE

Max input file fetched as remote reference

Type:

size

Default:

100m

Section:

server

Key:

maxinputsize

Env:

QGSWPS_SERVER_MAXINPUTSIZE

SERVER_MAXBUFFERSIZE

Max request buffer size.

Type:

size

Default:

1m

Section:

server

Key:

maxbuffersize

Env:

QGSWPS_SERVER_MAXBUFFERSIZE

SERVER_WORKDIR

Parent working directory where processes are executed. Each processes will create a working directory for storing results files and logs. The default value use the gettempdir() function.

Type:

path

Default:

System defaults

Section:

server

Key:

workdir

Env:

QGSWPS_SERVER_WORKDIR

SERVER_PARALLELPROCESSES

The number of parallel processes running execute requests. Extra processes will be queued.

Type:

int

Default:

1

Section:

server

Key:

parallelprocesses

Env:

QGSWPS_SERVER_PARALLELPROCESSES

SERVER_PROCESSLIFECYCLE

Maximal number of executions that can run in the same worker before being recreating the worker.

Type:

int

Default:

1

Section:

server

Key:

processlifecycle

Env:

QGSWPS_SERVER_PROCESSLIFECYCLE

SERVER_MAXQUEUESIZE

Maximal number of waiting tasks - extra tasks will return a 509 in synchronous execution.

Type:

int

Default:

100

Section:

server

Key:

maxqueuesize

Env:

QGSWPS_SERVER_MAXQUEUESIZE

SERVER_RESPONSE_TIMEOUT

Timeout for tasks execution in seconds. Task running longer that this time will be aborted and a timeout error is returned.

Type:

int

Default:

1800

Section:

server

Key:

response_timeout

Env:

QGSWPS_SERVER_RESPONSE_TIMEOUT

SERVER_RESPONSE_EXPIRATION

Response expiration in seconds. After that delay from the task’s end, data (working directory and status) for that task will be deleted.

Type:

int

Default:

86400

Section:

server

Key:

response_expiration

Env:

QGSWPS_SERVER_RESPONSE_EXPIRATION

SERVER_OWS_SERVICE_URL

The url for the service used to retrieve results as WMS/WFS references. Usually this will correspond to a QGIS server serving OWS services from results projects.

Type:

string

Default:

Request host url

Section:

server

Key:

ows_service_url

Env:

QGSWPS_SERVER_OWS_SERVICE_URL

SERVER_WMS_SERVICE_URL

Same as SERVER_OWS_SERVICE_URL

Type:

string

Default:

Request host url

Section:

server

Key:

wms_service_url

Deprecated in:

1.9

Deprecated detail:

Deprecated alternatives:

Replaced by SERVER_OWS_SERVICE_URL

Env:

QGSWPS_SERVER_WMS_SERVICE_URL

SERVER_RESULTS_MAP_URI

Base uri used for the MAP argument in WMS/WFS response references. Define a base URI to use for ‘MAP’ arguments in WMS/WFS responses, this uri may corresponds to an ‘alias in py-qgis-server <https://py-qgis-server.readthedocs.io/en/latest/schemes.html#scheme-aliases>’ _.

Type:

string

Default:

wps_result_map_uri

Section:

server

Key:

wms_service_url

Env:

QGSWPS_SERVER_RESULTS_MAP_URI

SERVER_CROSS_ORIGIN

Allows any origin for CORS. If set to ‘no’, allow only CORS for the ‘Origin’ header.

Type:

boolean

Section:

server

Key:

cross_origin

Env:

QGSWPS_SERVER_CROSS_ORIGIN

SERVER_RESTARTMON

The file to watch for restarting workers. When the modified date of the file is changed, the processing providers are reloaded. The restart is graceful, jobs terminate normally. During the restart process, the providers are reloaded, this allow for updating providers, models and scripts without interrupting the service.

Type:

path

Section:

server

Key:

restartmon

Env:

QGSWPS_SERVER_RESTARTMON

SERVER_SSL

Enable SSL endpoint

Type:

boolean

Default:

no

Version Added:

1.6.4

Section:

server

Key:

ssl

Env:

QGSWPS_SERVER_SSL

SERVER_SSL_CERT

Path to the SSL certificat file

Type:

path

Version Added:

1.6.4

Section:

server

Key:

ssl_cert

Env:

QGSWPS_SERVER_SSL_CERT

SERVER_SSL_KEY

Path to the SSL key file

Type:

path

Version Added:

1.6.4

Section:

server

Key:

ssl_key

Env:

QGSWPS_SERVER_SSL_KEY

SERVER_ENABLE_JOB_REALM

Enable job access control by associating a realm token to each job. Realm token are set by setting the ‘X-Job-Realm’ header to the token.

Type:

boolean

Default:

no

Version Added:

1.8

Section:

server

Key:

enable_job_realm

Env:

QGSWPS_SERVER_ENABLE_JOB_REALM

SERVER_ADMIN_REALM

Administrator realm token. It allows bearer to bypass any other token

Type:

path

Version Added:

1.8

Section:

server

Key:

admin_realm

Env:

QGSWPS_SERVER_ADMIN_REALM

LOGGING_LEVEL

Set the logging level

Type:

[‘DEBUG’, ‘INFO’, ‘WARNING’, ‘ERROR’, ‘CRITICAL’]

Default:

DEBUG

Section:

logging

Key:

level

Env:

QGSWPS_LOGGING_LEVEL

REDIS_HOST

Redis storage backend host

Type:

string

Default:

localhost

Section:

logstorage:redis

Key:

host

Env:

QGSWPS_REDIS_HOST

REDIS_PORT

Redis storage backend port

Type:

string

Default:

6379

Section:

logstorage:redis

Key:

port

Env:

QGSWPS_REDIS_PORT

REDIS_DBNUM

Redis storage backend database index

Type:

string

Section:

logstorage:redis

Key:

dbnum

Env:

QGSWPS_REDIS_DBNUM

REDIS_PREFIX

Redis storage backend key prefix.

Type:

string

Default:

pyqgiswps

Section:

logstorage:redis

Key:

prefix

Env:

QGSWPS_REDIS_PREFIX

CACHE_SIZE

The maximal number of QGIS projects held in cache. The cache strategy is LRU.

Type:

int

Default:

10

Section:

projects.cache

Key:

size

Env:

QGSWPS_CACHE_SIZE

CACHE_ROOTDIR

The directory location for QGIS project files.

Type:

path

Section:

projects.cache

Key:

rootdir

Env:

QGSWPS_CACHE_ROOTDIR

CACHE_STRICT_CHECK

Activate strict checking of project layers. When enabled, QGIS projects with invalid layers will be dismissed and an ‘Unprocessable Entity’ (422) HTTP error will be issued.

Type:

boolean

Default:

yes

Section:

projects.cache

Key:

strict_check

Env:

QGSWPS_CACHE_STRICT_CHECK

PROCESSING_PROVIDERS_MODULE_PATH

Path to QGIS processing providers modules

Type:

path

Section:

processing

Key:

providers_module_path

Env:

QGSWPS_PROCESSING_PROVIDERS_MODULE_PATH

PROCESSING_EXPOSED_PROVIDERS

Comma separated list of exposed QGIS processing internal providers. We do not recommend exposing all providers like qgis or native, it’s better to create your own script or model.

Type:

list

Default:

script,model

Section:

processing

Key:

exposed_providers

Env:

QGSWPS_PROCESSING_EXPOSED_PROVIDERS

PROCESSING_ACCESSPOLICY

Path to the access policy configuration file

Type:

path

Default:

PROCESSING_PROVIDERS_MODULE_PATH/accesspolicy.yml

Section:

processing

Key:

accesspolicy

Env:

QGSWPS_PROCESSING_ACCESSPOLICY

PROCESSING_VECTOR_FILEEXT

Define the default vector file extensions for vector destination parameters. If not specified, then the QGIS default value is used.

Type:

string

Section:

processing

Key:

vector.fileext

Env:

QGSWPS_PROCESSING_VECTOR_FILEEXT

PROCESSING_RASTER_FILEEXT

Define the default raster file extensions for raster destination parameters. If not specified, then the QGIS default value is used.

Type:

string

Section:

processing

Key:

raster.fileext

Env:

QGSWPS_PROCESSING_RASTER_FILEEXT

PROCESSING_RAW_DESTINATION_INPUT_SINK

Allow input value as sink for destination layers. This allow value passed as input value to be interpreted as path or uri sink definition. This enable passing any string that QGIS may use a input source but without open options except for the ‘layername=<name>’ option. Running concurrent jobs with this option may result in unpredictable behavior. For that reason it is considered as an UNSAFE OPTION and you should never enable this option if you are exposing the service publicly.

File path prefixed with ‘/’ will correspond to path located in the root directory specified by the PROCESSING_DESTINATION_ROOT_PATH option. Otherwise, they will be stored in the job folder.

Type:

boolean

Section:

processing

Key:

unsafe.raw_destination_input_sink

Env:

QGSWPS_PROCESSING_RAW_DESTINATION_INPUT_SINK

PROCESSING_DESTINATION_ROOT_PATH

Specify the root directory for storing destination layers files when the PROCESSING_RAW_DESTINATION_INPUT_SINK option is enabled. If not specified, file will be stored in the job folder.

Type:

string

Section:

processing

Key:

destination_root_path

Env:

QGSWPS_PROCESSING_DESTINATION_ROOT_PATH

PROCESSING_ADJUST_ELLIPSOID

Force the ellipsoid from the src project into the destination project. This only apply if the src project has a valid CRS.

Type:

boolean

Section:

processing

Key:

adjust_ellipsoid

Env:

QGSWPS_PROCESSING_ADJUST_ELLIPSOID

PROCESSING_DEFAULT_CRS

Set the CRS to use when no source map is specified. For more details on supported formats see the GDAL method GRSpatialReference::SetFromUserInput()

Type:

string

Default:

EPSG:4326

Section:

processing

Key:

default_crs

Env:

QGSWPS_PROCESSING_DEFAULT_CRS