Skip to main content

Create a Gateway

Expose your containers to the internet with a managed gateway.

Prerequisites​

  • A project created in your organization
  • A custom domain name you own (required for listeners)
  • Access to your domain's DNS settings
  • (Optional) At least one container deployed to route traffic to

Step-by-Step Guide​

1. Navigate to Gateways​

  1. Select your project from the project switcher
  2. Click Gateways in the left sidebar
  3. Click Create Gateway

2. Basic Configuration​

Gateway Name​

Enter a unique name for your gateway:

Valid: api-gateway, frontend, my-app
Invalid: My Gateway, api_gateway, gateway.prod
Naming Convention

Use lowercase letters, numbers, and hyphens only. Start with a letter.

3. Gateway Class​

Select the gateway class based on your bandwidth requirements:

ClassBandwidthPriceBest For
gw-small200 Mbps0.0365€/hourDevelopment, small applications
gw-medium500 Mbps0.0770€/hourMedium traffic applications
gw-large1 Gbps0.1290€/hourHigh-traffic production
gw-xlarge4 Gbps1.2300€/hourEnterprise, very high traffic
Choosing a Class

Start with gw-small for development. Upgrade to larger classes as your traffic grows.

4. Configure Listeners​

Listeners define how your gateway accepts incoming traffic. Click Add Listener to create one.

Listener Configuration​

FieldDescriptionRequired
Listener NameUnique identifier (e.g., my-listener)Yes
ProtocolHTTPS (recommended), TLS, or TCPYes
HostnameYour domain (e.g., api.example.com)Yes
PortNetwork port (443 for HTTPS)Yes
Hostname Required

You must provide your own hostname. SailOps does not provide default subdomains. Configure your domain's DNS to point to the gateway after creation.

Protocol Options​

  • HTTPS - Secure HTTP with automatic TLS certificate (recommended)
  • TLS - Generic TLS passthrough for non-HTTP protocols
  • TCP - Raw TCP traffic without TLS termination

When using HTTPS, TLS certificates are automatically provisioned and renewed via Let's Encrypt.

5. Create the Gateway​

  1. Review your configuration in the sidebar summary
  2. Verify the estimated cost
  3. Click Create Gateway
  4. Wait for provisioning (~15-30 seconds)

After Creation​

Configure DNS​

After your gateway is created, configure your DNS with an A record:

For subdomains:

Type: A
Name: api (or your subdomain)
Value: <IP-address-from-gateway-details>
TTL: 300

For apex domains:

Type: A
Name: @
Value: <IP-address-from-gateway-details>
TTL: 300

The IP address is displayed in your gateway details.

SSL Certificate Provisioning​

Once DNS is configured correctly:

  1. SailOps automatically detects the DNS change
  2. SSL certificate is provisioned (1-5 minutes)
  3. Your gateway is ready to receive traffic

Add Routes​

After the gateway is active, configure routes to direct traffic to your containers:

  1. Go to your gateway details
  2. Navigate to the Routes section
  3. Click Add Route
  4. Configure the route:
FieldDescriptionExample
PathURL path to match/ or /api
ContainerTarget containermy-app
PortContainer port3000

Test Your Gateway​

# Test your custom domain
curl https://api.yourdomain.com

# Test a specific route
curl https://api.yourdomain.com/health

Gateway Configuration​

Multiple Listeners​

A single gateway can have multiple listeners for different domains:

NameHostnamePortProtocol
api-listenerapi.example.com443HTTPS
app-listenerapp.example.com443HTTPS

Route Configuration​

Path Matching​

Paths are matched with prefix matching:

Gateway PathMatches
/All requests
/api/api, /api/users, /api/v1/data
/api/v1/api/v1, /api/v1/users

Path Prefix Stripping​

Control how paths are forwarded to containers:

OptionRequest PathContainer Receives
Keep path/api/users/api/users
Strip prefix/api/users/users

Route Priority​

Routes are matched in order of specificity:

  1. Exact matches first
  2. Longer path prefixes before shorter
  3. First defined route wins for equal specificity

Gateway States​

StateDescription
CreatingGateway is being provisioned
ActiveGateway is routing traffic
UpdatingConfiguration change in progress
ErrorIssue with gateway configuration

Examples​

Simple Web App​

Single container serving a web application:

ParameterValue
Gateway Namemy-app-gateway
Classgw-small
Listener Hostnamemyapp.example.com
Listener Port443 (HTTPS)

Route: Path / → Container web on port 3000

API + Frontend​

Separate containers for API and frontend on different subdomains:

ParameterValue
Gateway Nameplatform-gateway
Classgw-medium

Listeners:

HostnamePort
app.example.com443
api.example.com443

Routes:

HostnamePathContainerPort
api.example.com/api8080
app.example.com/frontend3000

Microservices​

Multiple services behind one gateway with path-based routing:

ParameterValue
Gateway Nameapi-gateway
Classgw-large
Listener Hostnameapi.example.com
Listener Port443

Routes:

PathContainerPort
/usersuser-service8080
/ordersorder-service8080
/paymentspayment-service8080
/api-docs80

Troubleshooting​

SSL Certificate Not Provisioning​

  1. Verify DNS is correctly configured
  2. Check DNS propagation (can take up to 48 hours)
  3. Ensure hostname exactly matches your DNS record
  4. Wait 5-10 minutes after DNS change
# Check DNS configuration
dig api.yourdomain.com

Gateway Not Responding​

  1. Verify DNS points to the correct endpoint
  2. Check SSL certificate status
  3. Verify at least one listener is configured
  4. Check container is running (if routes are configured)

502 Bad Gateway​

The gateway cannot reach the container:

  • Container may have crashed
  • Port mismatch between route and container
  • Container not ready yet
# Check container status
Dashboard → Containers → your-container → Status

504 Gateway Timeout​

Request took too long:

  • Container is overloaded
  • Long-running operation
  • Consider scaling your container

Next Steps​