Deploy to NGINX

Octopus.Nginx exported 2026-07-22 by Octopus Deploy belongs to ‘Package’ category.

Deploy the contents of a package and configure NGINX.

Parameters

When this step is included in a project’s deployment process, the parameters below can be set.

Host Name

Octopus.Action.Nginx.Server.HostName

The Host header that this server will listen on. The value can be a full (exact) name, a wildcard, or a regular expression. Leave empty to use any Host header.

Example: www.contoso.com

Bindings

Octopus.Action.Nginx.Server.Bindings

Configure the NGINX bindings. Stored as a JSON-encoded collection of binding objects with protocol, port, IP address, and optional SSL certificate settings.

Locations

Octopus.Action.Nginx.Server.Locations

Configure the virtual server locations. Stored as a JSON-encoded collection of location objects with path, directives, headers, and optional reverse proxy settings.

Base name for configuration files

Octopus.Action.Nginx.Server.ConfigName

This value defines the base name used for the NGINX configuration files. For example, on a Linux system the configuration files will be /etc/nginx/conf.d/[value].conf.d. If left blank, the package ID is used. Any illegal path characters are replaced by an underscore.

Default: #{Octopus.Action.Package.PackageId}.#{Octopus.Environment.Name}#{if Octopus.Deployment.Tenant.Name}.#{Octopus.Deployment.Tenant.Name}#{/if}

Optional features

Enable features by adding their IDs to Octopus.Action.EnabledFeatures (a comma-separated list).

.NET Configuration Transforms Octopus.Features.ConfigurationTransforms

Runs configuration file transforms. Enabled by default for package deployments.

Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles

Octopus.Action.Package.AutomaticallyRunConfigurationTransformationFiles

Run default XML transforms (True/False).

Octopus.Action.Package.AdditionalXmlConfigurationTransforms

Octopus.Action.Package.AdditionalXmlConfigurationTransforms

Comma- or newline-separated list of additional transform rules (e.g. Web.Release.config => Web.config).

.NET Configuration Variables Octopus.Features.ConfigurationVariables

Replace appSettings and connectionStrings in .config files. Enabled by default for package deployments.

Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings

Octopus.Action.Package.AutomaticallyUpdateAppSettingsAndConnectionStrings

Replace appSettings and connectionStrings in .config files (True/False).

Custom Installation Directory Octopus.Features.CustomDirectory

Change where the package is extracted on the target.

Octopus.Action.Package.CustomInstallationDirectory

Octopus.Action.Package.CustomInstallationDirectory

Path on the target to install the package.

Octopus.Action.Package.CustomInstallationDirectoryShouldBePurgedBeforeDeployment

Octopus.Action.Package.CustomInstallationDirectoryShouldBePurgedBeforeDeployment

Purge this directory before installation (True/False).

Octopus.Action.Package.CustomInstallationDirectoryPurgeExclusions

Octopus.Action.Package.CustomInstallationDirectoryPurgeExclusions

Newline-separated list of files/dirs to exclude from purge.

Custom Deployment Scripts Octopus.Features.CustomScripts

Execute scripts during the deployment (pre-deploy, deploy, post-deploy) without embedding them in your package.

Octopus.Action.CustomScripts.PreDeploy.

Octopus.Action.CustomScripts.PreDeploy.<ext>

Pre-deploy script body. The key’s is the script language extension: ps1 (PowerShell), sh (Bash), csx (C#), or py (Python).

Octopus.Action.CustomScripts.Deploy.

Octopus.Action.CustomScripts.Deploy.<ext>

Deploy-phase script body. The key’s is the script language extension: ps1 (PowerShell), sh (Bash), csx (C#), or py (Python).

Octopus.Action.CustomScripts.PostDeploy.

Octopus.Action.CustomScripts.PostDeploy.<ext>

Post-deploy script body. The key’s is the script language extension: ps1 (PowerShell), sh (Bash), csx (C#), or py (Python).

Structured Configuration Variables Octopus.Features.JsonConfigurationVariables

Replace settings in JSON, YAML, XML, and Java Properties files with Octopus variables. Enabled by default for package deployments.

Octopus.Action.Package.JsonConfigurationVariablesTargets

Octopus.Action.Package.JsonConfigurationVariablesTargets

Newline-separated list of target files (e.g. appsettings.json). Wildcards supported.

Substitute Variables in Templates Octopus.Features.SubstituteInFiles

Transforms files using the Octopus #{Variable} substitution syntax. Enabled by default for package deployments.

Octopus.Action.SubstituteInFiles.TargetFiles

Octopus.Action.SubstituteInFiles.TargetFiles

Newline-separated list of file names to transform (relative to package). Wildcards supported.

Octopus.Action.SubstituteInFiles.OutputEncoding

Octopus.Action.SubstituteInFiles.OutputEncoding

Encoding name for the output file (e.g. utf-8). Optional.

Step configuration using OCL

Example in Octopus Configuration Language (OCL):

step "deploy-to-nginx" {
    name = "Deploy to NGINX"
    properties = {
        Octopus.Action.TargetRoles = "web-server"
    }

    action {
        action_type = "Octopus.Nginx"
        properties = {
            Octopus.Action.Nginx.Server.Bindings = "[{\"protocol\":\"http\",\"port\":\"80\",\"ipAddress\":\"*\",\"enabled\":true}]"
            Octopus.Action.Nginx.Server.ConfigName = "myapp"
            Octopus.Action.Package.DownloadOnTentacle = "False"
            Octopus.Action.Package.FeedId = "octopus-server-built-in"
            Octopus.Action.Package.PackageId = "MyWebApp"
            Octopus.Action.RunOnServer = "false"
        }

        packages {
            acquisition_location = "Server"
            feed = "octopus-server-built-in"
            package_id = "MyWebApp"
        }
    }
}

Page updated on Wednesday, July 22, 2026