Skip to main content

Task Configuration

OptionTypeRequiredDefault ValueDescription
applicationblock listyesnoneDefines one more applications. See application schema below for details.
target_websitestringnononeSpecifies an existing target website. In this case the driver will not create a new website but instead use the existing one where it provisions the virtual applications only. Please read the details here.
managed_pipeline_modestringnoIIS defaultValid options are Integrated or Classic
enable_32bit_app_on_win64boolnoIIS defaultWhen true, enables a 32-bit application to run on a computer that runs a 64-bit version of Windows.
managed_runtime_versionstringnoIIS defaultValid options are v4.0, v2.0, None
start_modestringnoIIS defaultValid options are OnDemand or AlwaysRunning
idle_timeoutstringnoIIS defaultThe AppPool idle timeout in the form HH:mm:ss or [00w][00d][00h][00m][00s]
disable_overlapped_recycleboolnoIIS defaultDefines whether two AppPools are allowed to run while recycling
periodic_restartstringnoIIS defaultThe AppPool periodic restart interval in the form HH:mm:ss or [00w][00d][00h][00m][00s]
service_unavailable_responsestringnoIIS defaultIf this is set to HttpLevel and the app pool isn't running, HTTP.sys will return a 503 http-error. On the other hand if this is set to TcpLevel and the app pool isn't running, HTTP.sys will simply drop the connection. This may be useful when using external load balancers.
queue_lengthnumbernoIIS defaultIndicates to HTTP.sys how many requests to queue for an application pool before rejecting future requests.
start_time_limitstringnoIIS defaultSpecifies the time in the form [00w][00d][00h][00m][00s] that IIS waits for an application pool to start. If the application pool does not startup within the startupTimeLimit, the worker process is terminated and the rapid-fail protection count is incremented.
shutdown_time_limitstringnoIIS defaultSpecifies the time in the form [00w][00d][00h][00m][00s] that the W3SVC service waits after it initiated a recycle. If the worker process does not shut down within the shutdownTimeLimit, it will be terminated by the W3SVC service.
enable_udp_loggingboolnofalseEnables a UDP log-sink your application can log to. Please read the details here.
permit_iusrboolnotrueSpecifies whether you want to permit the IUSR-account on the local directory. When you disable this, you may need to tweak your web.config a bit. Read this for details.
bindingblock listyesnoneDefines one or two port bindings. See binding schema below for details.

application Block​

OptionTypeRequiredDefault ValueDescription
pathstringyesnoneDefines the path of the web application, containing the application files. If this folder is empty, the Placeholder App will be copied into.
aliasstringno/Defines an optional alias at which the application should be hosted below the website. If not set, the application will be hosted at the website level.
enable_preloadboolnoIIS defaultSpecifies whether the application should be pre-loaded.
virtual_directoryblock listnononeDefines optional virtual directories below this application. See virtual_directory schema below for details.

virtual_directory Block​

OptionTypeRequiredDefault ValueDescription
aliasstringyesnoneDefines the alias of the virtual directory
pathstringyesnoneDefines the path of the virtual directory

binding Block​

OptionTypeRequiredDefault ValueDescription
typestringyesnoneDefines the protocol of the port binding. Allowed values are http or https.
portstringyesnoneDefines the port label of a network block or a static port like "80". Static ports can only be used when hostname is also set. Otherwise use a nomad network-stanza to specify the port.
hostnamestringnoIIS defaultOnly listens to the specified hostname
require_sniboolnoIIS defaultDefines whether SNI (Server Name Indication) is required
ip_addressstringnoIIS defaultSpecifies the IP-Address of the interface to listen on
certificateblock listnononeSpecifies the certificate to use when using type=https. See certificate schema below for details.

certificate Block​

tip

Also refer to this advanced documentation.

OptionTypeRequiredDefault ValueDescription
thumbprintstringnononeSpecifies the thumbprint (hash) of a local and pre-installed certificate. Make sure the certificate is accessible to IIS by installing it to the My Certificates store on Local Machine.
pfx_filestringnononeSpecifies the path to a local certificate file. The file must be of type .pfx.
passwordstringnononeSpecifies the password for the given pfx-certificate file.
cert_filestringnononeSpecifies the path to a local certificate file in base64-encoded pem format. When using this option you also need to specify key_file.
key_filestringnononeSpecifies the path to a local private key file in base64-encoded pkcs8 format. When using this option you also need to specify cert_file.
use_self_signedboolnofalseSet this to true if you want to use a self-signed certificate with a validity of one year. Important: This is not intended for production usage and should only be used for short lived tasks like UI- or Integration tests.

Example​

note

The following example downloads a very simple HTML app from this repository. Feel free to inspect the ZIP before running the job.

job "static-sample-app" {
datacenters = ["dc1"]
type = "service"

group "app" {
count = 1

# See: https://nomad-iis.sevensolutions.cc/docs/tips-and-tricks/in-place-update
# disconnect {
# lost_after = "1m"
# }

network {
port "httplabel" {}
}

task "app" {
driver = "iis"

artifact {
source = "https://github.com/sevensolutions/nomad-iis/raw/main/examples/static-sample-app.zip"
destination = "local"
}

config {
application {
path = "local"
}

binding {
type = "http"
port = "httplabel"
}
}

resources {
cpu = 100
memory = 20
}
}
}
}