Gateways and hostnames
Weik.io 2026.2Create a gateway for each environment and set its hostnames and the rules for who may call it.
On this page
A platform administrator creates the gateways of each environment and the hostnames they answer on, such as api.example.com for production and api-test.example.com for devtest. An API deployment is served on the gateways of its environment. The same APIM instances at the hub serve the gateways of both environments.
Create a gateway#
$ weikio gateway create internal --env production --hostname api.example.com --networks 10.0.0.0/8 --default -yTarget: https://hub.example, environment production (--env)
gateway internal created (environment production, revision 12)
Listens on the hub's entrance 'public' to callers in 10.0.0.0/8.
api.example.com points at this hub. Requesting its certificate from Let's Encrypt. HTTPS is served once it's issued (weikio describe gateway internal).Every command that creates or changes a gateway prints who can reach it. For each hostname, it prints where the certificate comes from and when HTTPS is served. When a hostname’s DNS doesn’t point at the hub yet, it prints where the name points instead.
What a gateway sets#
| Flag | What it sets |
|---|---|
-- |
The names the gateway answers on. Add a DNS record for each that points at the hub. |
-- |
The caller addresses it admits, internet or a list of CIDR ranges. Every gateway must set it. |
-- |
The listener it answers on. Every hub has public, on port 443. An installation can add more, such as a port on a private network. |
-- |
none, optional or required. -- sets the authorities whose client certificates it accepts. |
-- |
The calls one caller address may make in each APIM instance, such as 600/1m. |
-- |
The limit of a subscription that sets none of its own, counted across the APIM instances. |
-- |
Where its APIs may send calls. |
-- |
The largest request body it accepts, such as 100MB. Without it the limit is 30,000,000 bytes, about 29MB, unless a route of the API version sets its own MaxRequestBodySize. |
-- |
Where its hostnames’ certificates come from. The value is automatic, public, platform, uploaded or the name of your own ACME authority. |
-- |
Makes it the default for a deployment or a subscription that sets no gateway. |
-- |
Who serves the gateway. It’s hub by default, or site for a gateway at a site. |
--like internal copies the rules of the gateway internal into the new one:
- The networks it admits
- Its entrances
- Its client certificate rule
- Its limits
- Its upstream networks
- Its largest request size
The hostnames and the environment are never copied. weikio gateway diff internal partner shows the rules two gateways set differently.
Two gateways in one environment#
Add a gateway partner for callers on the internet with client certificates, then deploy the API on both:
$ weikio gateway create partner --env production --like internal --hostname partner-api.example.com --networks internet --client-certificate required --authority partners=partner-ca.pem
$ weikio api deploy finance/invoices@v1 --env production --gateways internal,partnerA subscription belongs to one gateway, so the partner’s key opens the API only on partner-api.example.com.
$ weikio get gateways --env productionFor each gateway, weikio get gateways shows:
- Which hostnames it answers on
- Who serves it
- Whether it’s the default
- Whether the internet can reach it
- How many APIs and subscriptions it serves
weikio describe gateway internal describes one gateway in sentences and writes its limits in words, such as 600 calls per 1m from one caller address, counted by each APIM instance.
Stricter rules for one API#
A deployment can make a gateway’s rules stricter for its API, but not looser. When only the accounting network may call one API, give its deployment narrower networks on the shared gateway:
$ weikio api set-rules finance/invoices@v1 --env production --gateway internal --networks 10.20.0.0/16 --caller-limit 60/1m--clear removes the rules the deployment set.
Certificates#
Weik.io obtains and renews the certificates of gateway hostnames. For each name, it uses the first case that fits:
- For a name on the entrance
publicwhose DNS points at the hub, Weik.io proves it to Let’s Encrypt over TLS on port 443. - A name your own certificate authority covers, added with
weikio certificates authority add, is signed by that authority. - For a name in a DNS zone the platform has a connection for, such as Cloudflare, Hetzner, Azure or an RFC 2136 server, Weik.io proves it to Let’s Encrypt through DNS. Wildcard names work this way too.
- Any other name, such as an
.internalone, is signed by the platform’s own authority.
A certificate you upload with weikio gateway set internal --server-certificate company=chain.pem,key.pem is served in place of the platform’s for the names it covers.
weikio get certificates and Settings › Certificates list each name with where its certificate comes from and when it expires and renews. When a renewal keeps failing, Weik.io raises a problem.
The gateway accepts only TLS 1.2 and 1.3, and on TLS 1.2 only the AEAD suites. Certificates covers the hub’s own names and the DNS connections.
In the admin UI#
Open Settings › Gateways to see the gateways of every environment and the APIM instances that serve them, or to create one with New gateway.



