This guide walks you through setting up Caddy, a modern web server and reverse proxy, as a Windows service. You'll use Scoop, a command-line installer for Windows, and NSSM, a service manager, to streamline the setup process.
These days, IIS has been left in an "Ossified" state... Microsoft focuses more on Azure, where SSL management is much more automated in services like Azure App Services and Azure Front Door. IIS is still maintained, but it's no longer the cutting-edge solution for many use cases, and is missing modern features such as automated SSL renewals.
Some administrators may want to disregard this guide in case they need full control over SSL certificate acquisition, renewal, and deployment. This guide is not intended for enterprise use cases where certificates are often issued and managed by internal corporate CAs or external providers.
By the end of this setup:
venio.somedomain.com
will be proxied to a backend service on 127.0.0.1:8080
using Caddy.venio.somedomain.com
tbl_pj_ControlSetting
should have the following values defined manually in SQLBe syure to change the placeholder
venio.somedomain.com
in the URL appropriately!
update tbl_pj_ControlSetting set [Value] = 'https://venio.somedomain.com/VenioOnDemandAPI/vod/services' Where [Key] = 'VOD_API_URL' -- Change venio.somedomain.com to your organization's URL!
update tbl_pj_ControlSetting set [Value] = 'https://venio.somedomain.com/VenioWeb' Where [Key] = 'WEB_BASE_URL' -- Change venio.somedomain.com to your organization's URL!
8080
.Open an administrative PowerShell window. and run the following command to allow scripts to execute:
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
Run the following command to install Scoop:
Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression
Install aria2
, caddy
, and nssm
using Scoop:
scoop install --global aria2
scoop install --global caddy nssm
Create the configuration file for Caddy:
New-Item -Path "C:\ProgramData\scoop\persist\caddy\Caddyfile" -ItemType File -Force
Open the file C:\ProgramData\scoop\persist\caddy\Caddyfile
in a text editor (e.g., Notepad or VS Code). Replace venio.somedomain.com
with your site's base URL and edit the file to include the following configuration:
venio.somedomain.com {
tls {
alpn http/1.1 http/2 http/3
}
reverse_proxy 127.0.0.1:8080
}
Save and close the file.
cd C:\ProgramData\scoop\apps\nssm\current
nssm install Caddy
caddy.exe
(e.g., C:\ProgramData\scoop\apps\caddy\current\caddy.exe
).C:\ProgramData\scoop\apps\caddy\current\
).run --config C:\ProgramData\scoop\persist\caddy\Caddyfile
.Run the following command to start the service:
nssm start Caddy
This setup ensures a robust and flexible configuration for managing reverse proxies and site redirections in a Windows environment.
nssm status Caddy
nssm restart Caddy
nssm stop Caddy