Skip to content
Weik.ioDocs
2026.2
Try Weik.io

Gateways and hostnames

Weik.io 2026.2

Create 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#

Terminal
$ weikio gateway create internal --env production --hostname api.example.com --networks 10.0.0.0/8 --default -y
You see
Target: 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
--hostname The names the gateway answers on. Add a DNS record for each that points at the hub.
--networks The caller addresses it admits, internet or a list of CIDR ranges. Every gateway must set it.
--entrance 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.
--client-certificate none, optional or required. --authority sets the authorities whose client certificates it accepts.
--caller-limit The calls one caller address may make in each APIM instance, such as 600/1m.
--subscription-limit The limit of a subscription that sets none of its own, counted across the APIM instances.
--upstream-networks Where its APIs may send calls.
--max-request-size 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.
--certificate-source Where its hostnames’ certificates come from. The value is automatic, public, platform, uploaded or the name of your own ACME authority.
--default Makes it the default for a deployment or a subscription that sets no gateway.
--served-by 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:

Terminal
$ 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,partner

A subscription belongs to one gateway, so the partner’s key opens the API only on partner-api.example.com.

Terminal
$ weikio get gateways --env production

For 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:

Terminal
$ 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:

  1. For a name on the entrance public whose DNS points at the hub, Weik.io proves it to Let’s Encrypt over TLS on port 443.
  2. A name your own certificate authority covers, added with weikio certificates authority add, is signed by that authority.
  3. 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.
  4. Any other name, such as an .internal one, 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.

/settings/gateways
The Gateways page in Settings. The devtest gateway is on api-test.example.com and the production gateway on api.example.com. Both are open to callers on the internet and served by the hub.The Gateways page in Settings. The devtest gateway is on api-test.example.com and the production gateway on api.example.com. Both are open to callers on the internet and served by the hub.The Gateways page in Settings. The devtest gateway is on api-test.example.com and the production gateway on api.example.com. Both are open to callers on the internet and served by the hub.The Gateways page in Settings. The devtest gateway is on api-test.example.com and the production gateway on api.example.com. Both are open to callers on the internet and served by the hub.
In Settings › Gateways, you see the hostnames each environment answers on and who can call each gateway.

Sign in to the live demo

Sign in with the shared viewer account. It can open every screen of the example projects but can't change anything.

E-mail
viewer@demo.weik.io
Password
try-weikio-live-demo
Open the live demo