Skip to content

Server settings

This page describes the basic structure of a server .mgc configuration file, the purpose of its key sections, and the parameters of the general block.


The configuration is split into logical blocks:

  • general — global server parameters (address, port, mode, cryptography)
  • app — application-level server behavior settings
  • web — web service parameters
  • net — network service parameters

general

Core listening parameters, operating mode, and cryptographic settings.

app

Application behavior and parameters that depend on the server type.

web

Web routing, reverse proxy, and related service settings.

net

Network service settings and low-level traffic processing.

The general block defines the server’s network and cryptographic parameters.
The app block defines application behavior, such as web, net, and other service-specific variants.


The general block contains parameters that define the basic behavior of a server instance: listening address, port, transport mode, and TLS parameters.

general: [
address: "127.0.0.1"
port: 443
mode: "https"
php_fpm_address: "127.0.0.1:9000"
crypto_provider: "awslcrs"
protocol_version: ["tls12", "tls13"]
]
  • HTTPS reverse proxy — mode: "https" + crypto_provider
  • TCP proxy — mode: "tcp"
  • UDP service (DNS, VoIP, etc.) — mode: "udp"
  • Local development server — address: "127.0.0.1" + a non-standard port

HTTPS reverse proxy

Use mode: "https" and specify crypto_provider and protocol_version to control TLS behavior.

Local development

For local startup, it is convenient to use 127.0.0.1 and a separate port such as 4433.

FieldTypeDescriptionExample
addressstringIP address for listening for incoming connections127.0.0.1
portnumberServer port443, 4433
modestringServer operating mode (http, https, tcp, udp)“https”
php_fpm_addressstringPHP-FPM address for handling PHP requests127.0.0.1:9000
crypto_providerstringTLS cryptographic backend implementation”awslcrs”
protocol_versionstring[]List of allowed TLS versions[“tls12”, “tls13”]

Plain HTTP without TLS encryption.

Suitable for:

  • internal networks
  • local development
  • operation behind an external TLS terminator
  • awslcrs — AWS crypto library (based on BoringSSL/OpenSSL)
  • ringrustls-based backend
  • magma — GOST cryptosystem
  • grasshopper — GOST R 34.12-2015
  • openssl — OpenSSL

Supported values, for example:

  • tls12
  • tls13

Recommended set for modern configurations:

protocol_version: ["tls12", "tls13"]

  1. Set address and port.
  2. Choose mode according to the service type.
  3. For https, set crypto_provider.
  4. Configure protocol_version.
  5. Add php_fpm_address if needed for PHP scenarios.

Minimal example for local HTTPS development

general: [
address: "127.0.0.1"
port: 4433
mode: "https"
crypto_provider: "openssl"
protocol_version: ["tls12", "tls13"]
]