Creating a New Site
Note: An SSL Certificate needs to be uploaded before a site can be created.
To create a new site entry, three pieces of information are needed.
- Hostname (this cannot be a wildcard)
- Certificate name
- Code service label
The hostname is up to you, and the certificate name is also decided by you when uploaded. The code service label is the name of the code service that you intend traffic for this hostname to go to. If you don’t know what your code service’s name is, you can find it in the Stratum dashboard.
The CLI sites create command is used to create the site, taking the form
catalyze -E "<your_env_alias>" sites create <hostname> <code service label> <certificate name>. For example, to set up a site mapping
example.com to a code service named
code-1 using an uploaded cert named
catalyze -E "<your_env_alias>" sites create .example.com code-1 example
Note the leading
. - this is required for apex domains.
If you’ve uploaded a wildcard cert and intend to use it with multiple subdomains, that cert can be used as many times as needed:
catalyze -E "<your_env_alias>" sites create api1.example.com code-1 wildcard-example catalyze -E "<your_env_alias>" sites create api2.example.com code-2 wildcard-example catalyze -E "<your_env_alias>" sites create api3.example.com code-3 wildcard-example
In order for your service proxy to pick up the new site, it needs to be redeployed:
catalyze -E "<your_env_alias>" redeploy service_proxy
If a site needs to be removed, use the sites rm command.