Skip to content

Web settings

This page describes the web block: virtual hosts, path handling (/:, /api, /static), reverse proxying and load balancing, static file serving, and upstream health checks.


web is the HTTP(S) service configuration: a virtual host (domain + TLS/ALPN) plus path-based routing rules.

Virtual Host (domain)

Host domain, HTTP version via ALPN, and certificates (certs).

Paths (routing)

Rules for prefixes such as /: [...], /api: [...], /static: [...].

Upstream + health check

Reverse proxy or load balancing plus backend availability monitoring.

localhost: [
http_version: "http3"
certs: certs
/: [
balance: [
["https://backend1.example.com" 1]
["https://backend2.example.com" 1]
]
check: [
check_type: "http"
target: "/health"
interval: 5
max_fails: 3
]
]
]

  • domain — virtual host domain (localhost in the example)
  • certs — certificate variable from config.mgc such as certs
  • http_version — HTTP versions the host advertises via ALPN

HTTP/1.1 (ALPN: http/1.1)

If your clients or load balancers do not support HTTP/3, start with http2. Enable http3 only after compatibility checks.


Each path is defined as a key prefix, for example /: [...], /api: [...], or /static: [...].
Inside the block you define how requests are handled: reverse proxying, load balancing, or serving files.

/: [
reverse_proxy: "https://backend1.example.com"
]
/: [
balance: [
["https://backend1.example.com" 1]
["https://backend2.example.com" 1]
]
]
/: [
serve_in: "/etc/meshgate/default/"
]

Health checks allow Meshgate to automatically exclude failed upstreams.

check: [
check_type: "http"
target: "/health"
interval: 5
max_fails: 3
]
FieldTypeDescriptionExample
check_typestringCheck protocol: http or tcp”http”
targetstringHTTP endpoint to probe (tcp usually does not use it)“/health”
intervalnumberCheck interval in seconds5
max_failsnumberConsecutive failures before the upstream is marked failed3