Virtual Host (domain)
Host domain, HTTP version via ALPN, and certificates (certs).
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 isweb 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 certshttp_version — HTTP versions the host advertises via ALPNhttp_versionHTTP/1.1 (ALPN: http/1.1)
HTTP/1.1 + HTTP/2 (ALPN: http/1.1 + h2)
HTTP/1.1 + HTTP/2 + HTTP/3 (ALPN: http/1.1 + h2 + h3)
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]| Field | Type | Description | Example |
|---|---|---|---|
| check_type | string | Check protocol: http or tcp | ”http” |
| target | string | HTTP endpoint to probe (tcp usually does not use it) | “/health” |
| interval | number | Check interval in seconds | 5 |
| max_fails | number | Consecutive failures before the upstream is marked failed | 3 |