Configuring Gateway Settings
1. Setting Up Gateway Name and Description
| Field | Purpose | Example |
name | Unique gateway identifier | prod-edge-gw |
description | Human-readable summary | "Public REST APIs" |
tags | Labels for filtering | [env:prod, team:platform] |
owner | Responsible team/contact | platform@co.com |
Example: Kong declarative config
_format_version: "3.0"
_transform: true
services:
- name: orders-api
url: https://orders.internal:8443
tags: [env:prod, team:orders]
connect_timeout: 5000
read_timeout: 30000
write_timeout: 30000
2. Configuring Base Path and Domain
| Setting | Description | Example |
hosts | Domain(s) the gateway serves | api.example.com |
base_path | Prefix stripped from upstream | /v1 |
strip_path | Remove match prefix before proxy | true |
preserve_host | Forward original Host header | false |
3. Setting Default Protocol
| Protocol | Use | Config |
http | Plain dev/internal | listen 80 |
https | Public TLS | listen 443 ssl |
http2 | Multiplexed HTTPS | http2 on |
http3 | QUIC over UDP NEW | listen 443 quic |
grpc | HTTP/2 + protobuf | grpc_pass |
ws/wss | WebSocket upgrade | proxy_http_version 1.1 |
4. Configuring Port Mappings
| Port | Purpose |
| 80 | HTTP, typically redirect to 443 |
| 443 | HTTPS public traffic |
| 8443 | HTTPS admin / internal |
| 8001/8444 | Kong admin API (HTTP/HTTPS) |
| 9090 | Metrics scrape (Prometheus) |
| 15021 | Istio health/status |
5. Setting Gateway Timeout Values
| Timeout | Default | Description |
connect_timeout | 5s | TCP/TLS connect to upstream |
read_timeout | 60s | Wait for upstream bytes |
write_timeout | 60s | Send body to upstream |
idle_timeout | 75s | Keep-alive idle close |
request_timeout | 30s | End-to-end ceiling |
header_timeout | 10s | Receive full headers |
6. Configuring Request Size Limits
| Limit | Default | Notes |
client_max_body_size | 1MB | Reject > with 413 |
client_header_buffer_size | 1KB | Per-header line |
large_client_header_buffers | 4 8KB | Big cookies/JWT |
max_request_line | 8KB | URL + method + version |
7. Setting Connection Pool Settings
| Setting | Description | Recommended |
max_connections | Upstream cap per worker | 1024 |
max_pending_requests | Queue before reject | 100 |
max_requests_per_connection | Recycle threshold | 1000 |
max_retries | Auto-retry attempts | 3 |
8. Configuring Keep-Alive Settings
| Setting | Purpose | Value |
keepalive | Idle conns per upstream | 64 |
keepalive_timeout | Close after idle | 60s |
keepalive_requests | Reqs per connection | 1000 |
tcp_keepalive | OS-level probe | 30s |
add_header X-Gateway "edge-prod" always;
add_header X-Request-ID $request_id always;
add_header Strict-Transport-Security "max-age=63072000; includeSubDomains" always;
add_header X-Content-Type-Options "nosniff" always;
more_clear_headers "Server" "X-Powered-By";
| Header | Purpose |
X-Request-ID | Correlate logs across services |
X-Gateway | Identify gateway instance |
Server | Remove to hide implementation |
Cache-Control | Default caching policy |
10. Configuring Buffer Sizes
| Buffer | Default | Tuning |
proxy_buffer_size | 4KB | Headers from upstream |
proxy_buffers | 8 4KB | Body buffering |
proxy_busy_buffers_size | 8KB | While sending to client |
output_buffers | 2 32KB | To client socket |
Warning: Disable buffering (proxy_buffering off) for SSE/streaming endpoints to avoid latency.