Skip to content

Instantly share code, notes, and snippets.

@indy-singh
Created December 5, 2024 12:42
Show Gist options
  • Select an option

  • Save indy-singh/8eda0f741e0d26905db5e030460b78d0 to your computer and use it in GitHub Desktop.

Select an option

Save indy-singh/8eda0f741e0d26905db5e030460b78d0 to your computer and use it in GitHub Desktop.
IISCaddyfile
{
debug # because error driven development is much easier
http_port 8080 # IIS uses port 80, don't conflict with it
auto_https off # this isn't replacing apache, so we don't need this fancy feature
skip_install_trust # this isn't replacing apache, so we don't need this fancy feature
}
# this is a snippet: https://caddyserver.com/docs/caddyfile/concepts#snippets
# it is not a run-time thing! It is a parse-time thing
(base_config) {
# set where the files for the deployed app are
# so we know where to look for the blue-green file
root * {args.0}
@isBlue file blue.release
@isGreen file green.release
header @isBlue X-CW-Active-Deploy "blue"
header @isGreen X-CW-Active-Deploy "green"
reverse_proxy @isBlue localhost:{args.1}
reverse_proxy @isGreen localhost:{args.2}
}
http://alpha.localiis {
#args: app deploy folder, blue port (always even), green port (always odd)
import base_config "C:\wwwroot\alpha" "5000" "5001"
}
http://beta.localiis {
import base_config "C:\wwwroot\beta" "5002" "5003"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment