### Install QEMU on Fedora Source: https://angie.software/adc/docs/install/cloud-init/install-qcow2-0.5.2 Installs QEMU and related virtualization utilities on Fedora systems. ```bash $ sudo dnf install qemu libvirt libguestfs-tools libguestfs virt-viewer virt-install ``` -------------------------------- ### Install QEMU on Ubuntu/Debian Source: https://angie.software/adc/docs/install/cloud-init/install-qcow2-0.5.2 Installs QEMU and related virtualization utilities on Ubuntu and Debian systems. ```bash $ sudo apt update $ sudo apt install -y \ qemu-kvm qemu-system-x86 qemu-utils \ libvirt-daemon-system libvirt-clients virtinst virt-manager \ ovmf cpu-checker ``` -------------------------------- ### cert-config match command examples Source: https://angie.software/adc/docs-0.8.2/management/cli-commands Provides examples of using the 'cert-config match' command to verify if a certificate and its corresponding private key are a valid pair. ```none (cert-config)$$ match site1.crt site1.key Certificate and key match (cert-config)$$ match site1.crt site2.key Certificate and key DO NOT match (cert-config)$$ ``` -------------------------------- ### Angie ADC Configuration Mode Example Source: https://angie.software/adc/docs/management/cli-commands This example demonstrates entering configuration mode, setting a system interface type to DHCP, showing the configuration differences, and committing the changes. ```none $$ configuration ## set system interface enp0s2 type dhcp ## show -> Current configuration set system interface enp0s2 type static set system interface enp0s2 ip address 10.21.20.31/22 set system interface enp0s2 ip gateway 10.21.20.1 set system interface enp0s2 ip dns 8.8.8.8 set system interface enp0s2 ip dns 1.1.1.1 -> Candidate configuration set system interface enp0s2 type dhcp ## commit ``` -------------------------------- ### GlobalConfiguration Example Source: https://angie.software/anic/docs/configuration/globalconfiguration-resource Example of a GlobalConfiguration resource defining UDP and TCP listeners for DNS traffic. ```yaml apiVersion: k8s.angie.software/v1alpha1 kind: GlobalConfiguration metadata: name: angie-configuration namespace: angie-ingress spec: listeners: - name: dns-udp port: 5353 protocol: UDP - name: dns-tcp port: 5353 protocol: TCP ``` -------------------------------- ### Comprehensive Angie Configuration with Metrics Source: https://angie.software/angie/docs/configuration/modules/http/http_api?ra=yes An example of a complete Angie HTTP server configuration that includes various modules like resolver, upstream, caching, connection limits, request limits, and access to HTTP API metrics. This configuration demonstrates how to integrate metrics access within a typical server setup. ```nginx http { resolver 127.0.0.53 status_zone=resolver_zone; proxy_cache_path /var/cache/angie/cache keys_zone=cache_zone:2m; limit_conn_zone $binary_remote_addr zone=limit_conn_zone:10m; limit_req_zone $binary_remote_addr zone=limit_req_zone:10m rate=1r/s; upstream upstream { zone upstream 256k; server backend.example.com service=_example._tcp resolve max_conns=5; keepalive 4; } server { server_name www.example.com; listen 443 ssl; status_zone http_server_zone; proxy_cache cache_zone; proxy_cache_valid 200 10m; access_log /var/log/access.log main; location / { root /usr/share/angie/html; status_zone location_zone; limit_conn limit_conn_zone 1; limit_req zone=limit_req_zone burst=5; } location /status/ { api /status/; allow 127.0.0.1; deny all; } } } ``` -------------------------------- ### Configure Stream Server Zones and Connection Limits Source: https://angie.software/adc/docs/monitoring-and-statistics/console-light Example Nginx configuration demonstrating the setup of `limit_conn_zone`, `limit_conn`, and `status_zone` directives within a stream context. Requires specific directives to be set in server or stream contexts. ```nginx stream { # ... limit_conn_zone $connection zone=limit-conn-stream:10m; server { # ... limit_conn limit-conn-stream 1; status_zone foo; } } ``` -------------------------------- ### Install Angie Console Light Package Source: https://angie.software/news/articles/multifaceted-monitoring Install the Console Light package using apt-get. This is the first step to enable the monitoring interface. ```bash sudo apt-get install angie-console-light ``` -------------------------------- ### Listener Configuration Example Source: https://angie.software/anic/docs/configuration/globalconfiguration-resource Example of a listener configuration specifying the name, port, and protocol for incoming traffic. ```yaml name: dns-tcp port: 5353 protocol: TCP ``` -------------------------------- ### Postgres Configuration Example Source: https://angie.software/angie/docs/installation/external-modules/postgres Example Nginx configuration demonstrating how to use the Postgres module for database operations. Includes setting up an upstream, defining output format, and creating locations for SQL queries. ```nginx http { upstream database { postgres_server 127.0.0.1 dbname=ang_test user=ang_test password=ang_test; } server { listen 80; postgres_output text; location /create { postgres_pass database; postgres_query "CREATE TABLE cats (id integer, name text)"; } location /insert { postgres_pass database; postgres_query "INSERT INTO cats (id, name) VALUES ($arg_id, '$arg_name')"; } location /select { postgres_pass database; postgres_query "SELECT name FROM cats WHERE id=$arg_id"; } } } ``` -------------------------------- ### MP4 Pseudo-Streaming Request Example Source: https://angie.software/angie/docs/configuration/modules/http/http_mp4 Example of an HTTP request to an MP4 file with a specified start time for pseudo-streaming. ```none http://example.com/elephants_dream.mp4?start=238.88 ``` -------------------------------- ### Load Echo Module for Configuration Example Source: https://angie.software/angie/docs/installation/external-modules/geoip2 Load the echo module, which is used in the provided configuration example for displaying information. ```nginx load_module modules/ngx_http_echo_module.so; ``` -------------------------------- ### Stream Module Configuration Example Source: https://angie.software/angie/docs/configuration/modules/stream This example demonstrates a basic configuration for the Stream module, including defining upstream servers, setting up server blocks for TCP and UDP listeners, and configuring proxying behavior. ```nginx worker_processes auto; error_log /var/log/angie/error.log info; events { worker_connections 1024; } stream { upstream backend { hash $remote_addr consistent; server backend1.example.com:12345 weight=5; server 127.0.0.1:12345 max_fails=3 fail_timeout=30s; server unix:/tmp/backend3; } upstream dns { server 192.168.0.1:53535; server dns.example.com:53; } server { listen 12345; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass backend; } server { listen 127.0.0.1:53 udp reuseport; proxy_timeout 20s; proxy_pass dns; } server { listen [::1]:12345; proxy_pass unix:/tmp/stream.socket; } } ``` -------------------------------- ### Install Angie Package Source: https://angie.software/news/articles/acme-angie-avtomaticheskii-https Installs the Angie web server package on the Debian system. ```bash sudo apt-get install -y angie ``` -------------------------------- ### Example Usage and Verification Source: https://angie.software/news/articles/wasm-angie Demonstrates how to make a request to the configured Angie server and verifies the WASM module file. ```bash $ curl "http://127.0.0.1:8080?id=1&id2=5" sql(1..5)=foo2,foo3,foo4 $ ls -lh "conf/ngx_http_vars.wasm" -rwxr-xr-x 1 demo demo 1.3M Nov 2 11:34 conf/ngx_http_vars.wasm ``` -------------------------------- ### Install Yandex.Cloud CLI Source: https://angie.software/anic/docs/installation/installation-in-YC Installs the Yandex.Cloud CLI tool for managing cloud resources. Follow the interactive prompts for authentication. ```bash curl -sSL https://storage.yandexcloud.net/yandexcloud-yc/install.sh | bash yc init ``` -------------------------------- ### Zstandard Module Configuration Example Source: https://angie.software/angie/docs/installation/external-modules/zstd Configure Zstandard compression for dynamic responses and static files. Set compression level, minimum response length, and specify content types to compress. This example also shows how to handle pre-compressed .zst files. ```nginx server { listen 80 default_server; zstd_types text/plain text/css; zstd_min_length 256; # Минимальная длина ответа для сжатия zstd_comp_level 3; # Уровень сжатия (от 1 до 22) # Динамическое сжатие файлов location / { zstd on; root /usr/share/angie/html; } # Динамическое сжатие ответов от бэкенда location /bk/ { zstd on; proxy_pass http://127.0.0.1:8081/; } # Использование заранее сжатых файлов .zst location /static/ { zstd_static on; root /usr/share/angie; } } server { listen 8081; location / { root /usr/share/angie/html; index index.html; } } ``` -------------------------------- ### Install OctoDNS and Cloudflare Provider Source: https://angie.software/news/articles/acme-angie-avtomaticheskii-https Install the necessary OctoDNS package and the Cloudflare provider using pip. ```console $ pip install octodns octodns_cloudflare ``` -------------------------------- ### Basic Memcached Configuration Example Source: https://angie.software/adc/docs/configuration_lb/reference/http/http_memcached This example shows a basic server block configuration for using Memcached with Angie. It sets the memcached key and specifies the memcached server address. A fallback location is defined for error handling. ```nginx server { location / { set $memcached_key "$uri?$args"; memcached_pass host:11211; error_page 404 502 504 = @fallback; } location @fallback { proxy_pass http://backend; } } ``` -------------------------------- ### Cloud-Init Meta-data Example Source: https://angie.software/adc/docs-0.6.0/install/cloud-init/install-qcow2-0.5.2 Define essential information for the virtual machine, such as its unique identifier and hostname. ```yaml instance-id: my-adc1 local-hostname: my-server ``` -------------------------------- ### Stream Upstream Probe Configuration Example Source: https://angie.software/adc/docs/configuration_lb/reference/stream/stream_upstream_probe Example of configuring an upstream probe for a backend server. This includes setting timeouts, intervals, test conditions, and send/receive modes. ```nginx server { listen ...; # ... proxy_pass backend; upstream_probe_timeout 1s; upstream_probe backend_probe port=12345 interval=5s test=$good essential fails=3 passes=3 max_response=512k mode=onfail "send=data:GET / HTTP/1.0\r\n\r\n"; } ``` -------------------------------- ### Cache Shard Configuration Example Source: https://angie.software/adc/docs-0.6.0/configuration_lb/reference/http/http_api Example JSON structure representing cache shards and their properties like size and cold status. ```json { "name_zone": { "shards": { "/path/to/shard1": { "size": 0, "cold": false }, "/path/to/shard2": { "size": 0, "cold": false } } } } ``` -------------------------------- ### HTTP Access Control Configuration Example Source: https://angie.software/adc/docs-0.8.2/configuration_lb/reference/http/http_access This example demonstrates how to configure access control within a location block. It denies access to a specific IP, allows broader access to an IPv4 subnet and a different IPv4 network, allows access to an IPv6 network, and finally denies all other access. Rules are processed sequentially. ```nginx location / { deny 192.168.1.1; allow 192.168.1.0/24; allow 10.1.1.0/16; allow 2001:0db8::/32; deny all; } ``` -------------------------------- ### Proxy Protocol TLV Examples Source: https://angie.software/adc/docs-0.6.0/configuration_lb/reference/stream/stream These examples demonstrate how to access TLV (Type-Length-Value) data from the PROXY protocol header. The PROXY protocol must be enabled using the proxy_protocol parameter in the listen directive. Specific TLV types can be accessed by name or numerical value. ```none $proxy_protocol_tlv_alpn $proxy_protocol_tlv_0x01 ``` ```none $proxy_protocol_tlv_ssl_version $proxy_protocol_tlv_ssl_0x21 ``` -------------------------------- ### Basic Angie Server Configuration Example Source: https://angie.software/adc/docs/configuration_lb/reference/core A foundational Nginx configuration block setting up user, worker processes, error logging, and event handling with kqueue and connection limits. ```nginx user www www; worker_processes 2; error_log /var/log/error.log info; events { use kqueue; worker_connections 2048; } ``` -------------------------------- ### MP4 Pseudo-Streaming with Start and End Times Source: https://angie.software/angie/docs/configuration/modules/http/http_mp4 Example of an HTTP request to an MP4 file specifying both start and end times for pseudo-streaming. ```none http://example.com/elephants_dream.mp4?start=238.88&end=555.55 ``` -------------------------------- ### HLS Configuration with Encryption Source: https://angie.software/angie/docs/installation/external-modules/vod Example Nginx configuration for serving HLS streams with sample-AES-Cenc encryption and DRM enabled. This setup is suitable for adaptive bitrate streaming. ```nginx location ~ ^/cenchls/p/\d+/(sp/\d+/)?serveFlavor/entryId/([^/]+)/(.*) { vod hls; vod_hls_encryption_method sample-aes-cenc; vod_hls_encryption_key_format "urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"; vod_hls_encryption_key_format_versions "1"; vod_drm_enabled on; vod_drm_request_uri "/udrm/system/ovp/$vod_suburi"; vod_last_modified_types *; add_header Access-Control-Allow-Headers '*'; add_header Access-Control-Expose-Headers 'Server,range,Content-Length,Content-Range'; add_header Access-Control-Allow-Methods 'GET, HEAD, OPTIONS'; add_header Access-Control-Allow-Origin '*'; expires 100d; } ``` -------------------------------- ### Configure ip6tables for IPv6 Access Control Source: https://angie.software/adc/docs/common-tasks-and-examples/ipv6 This example demonstrates an ip6tables configuration for managing IPv6 traffic. It mirrors the iptables setup but includes IPv6-specific rules like 'ipv6-icmp' and adjusts the UDP port for '521'. ```bash [root@angie-va angie-va]# ip6tables -S -P INPUT DROP -P FORWARD DROP -P OUTPUT ACCEPT -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 443 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 2022 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 179 -j ACCEPT -A INPUT -p ipv6-icmp -j ACCEPT -A INPUT -p ospf -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 521 -j ACCEPT -A INPUT -j REJECT --reject-with icmp6-adm-prohibited ``` -------------------------------- ### cert-config list command example Source: https://angie.software/adc/docs-0.8.2/management/cli-commands Demonstrates how to list all traffic certificates and keys managed by Angie ADC, indicating their validity status. ```none (cert-config)$$ list cp.crt : invalid cp.key : invalid site1.crt: certificate site1.key: key ``` -------------------------------- ### Launch Virtual Machine with virt-install Source: https://angie.software/adc/docs-0.6.0/install/cloud-init/install-qcow2-0.5.2 This command deploys the Angie ADC qcow2 image on a KVM (QEMU) virtual machine. Ensure the seed.iso is attached as a CD-ROM. ```bash virt-install \ --virt-type kvm \ --name adc \ --ram 2048 \ --vcpus 2 \ --disk angie-adc-0.5.2-x86_64.cloud-init.qcow2,format=qcow2 \ --disk seed.iso,device=cdrom \ --network=bridge:virbr0 \ --graphics vnc,listen=0.0.0.0 \ --os-variant=centos8 \ --import ``` -------------------------------- ### Install Helm Chart Skipping CRDs Source: https://angie.software/anic/docs/installation/installation-with-helm If Custom Resource Definitions (CRDs) are not needed or already installed, you can skip their installation using the `--skip-crds` flag with the `helm install` command. ```console $ helm install <имя_релиза> <путь_до_чарта> --skip-crds ``` -------------------------------- ### Install ANIC Helm Chart Source: https://angie.software/anic/docs/installation/installation-with-helm Install the Helm chart by specifying a release name and the path to the chart. Helm will generate Kubernetes manifests and install them. ```console $ helm install <имя_релиза> <путь_до_чарта> ``` -------------------------------- ### Enter BFD Configuration Mode Source: https://angie.software/adc/docs/routing/bfd Navigate to the BFD configuration mode to begin setting up a peer. This is the initial step before defining peer addresses. ```console angie-va# conf t angie-va(config)# bfd angie-va(config-bfd)# peer ``` -------------------------------- ### Create Working Directory and Virtual Environment Source: https://angie.software/news/articles/acme-angie-avtomaticheskii-https Set up a dedicated directory and a Python virtual environment for OctoDNS. Activate the environment before proceeding. ```console $ sudo mkdir /dns $ cd /dns $ python -m venv env $ source env/bin/activate ``` -------------------------------- ### cert-config info command example Source: https://angie.software/adc/docs-0.8.2/management/cli-commands Shows how to display information about a traffic certificate using the 'cert-config info' command with a specified filename. ```none (cert-config)$$ info traffic name site1.crt Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: sha1WithRSAEncryption Issuer: C = RU, ST = Moscow, O = Angie, OU = EVO, CN = Root CA Validity Not Before: Feb 18 12:23:08 2025 GMT Not After : Feb 18 12:23:08 2027 GMT Subject: CN = Demo Certificate, ST = Moscow, C = RU, O = Angie, OU = EVO Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (4096 bit) Modulus: ... (cert-config)$$ ``` -------------------------------- ### Install Auxiliary Packages for Angie Repository Source: https://angie.software/news/articles/acme-angie-avtomaticheskii-https Installs necessary packages for connecting to the Angie repository on Debian systems. ```bash sudo apt-get update sudo apt-get install -y ca-certificates curl ``` -------------------------------- ### Using Include Directive for Configuration Management Source: https://angie.software/adc/docs-0.7.3/configuration_lb/reference/configfile Demonstrates how to use the 'include' directive in the main 'angie.conf' file to reference external configuration files for HTTP and stream traffic, promoting modularity. ```nginx include /etc/angie/http.d/*.conf; include /etc/angie/stream.d/*.conf; ``` -------------------------------- ### Install ACME Module and yq Source: https://angie.software/news/articles/acme-angie-avtomaticheskii-https Installs the necessary angie-module-cgi and yq packages for managing DNS records and YAML files. ```bash $ sudo apt-get install -y angie-module-cgi yq ``` -------------------------------- ### Nginx Configuration for Backup Server Groups Source: https://angie.software/adc/docs/configuration_lb/backup-server-groups This example demonstrates how to configure primary and backup server groups using directives like 'backup', 'backup=n', and 'backup_switch permanent'. It shows different levels of backup servers and a permanent switchover with a time limit. ```nginx upstream my_backend { server primary1.example.com; server primary2.example.com; server backend.example.com service=http resolve backup=prio; server backup1a.example.com backup; server backup1b.example.com backup; server backup2a.example.com backup=2; server backup2b.example.com backup=2; backup_switch permanent=2m; } ``` -------------------------------- ### Deploy Angie ADC qcow2 Image Source: https://angie.software/adc/docs/install/install-qcow2 Moves the Angie ADC qcow2 image to the libvirt images directory and then uses virt-install to create and start a new virtual machine from the image. ```bash $ sudo mv angie-adc-1.0-rc2-x86_64.cloud-init.qcow2 /var/lib/libvirt/images/ $ sudo virt-install --name angie-adc-1.0-rc2 --ram 2048 --disk /var/lib/libvirt/images/angie-adc-1.0-rc2-x86_64.cloud-init.qcow2 --os-variant generic --import ``` -------------------------------- ### Create Configuration Directory Source: https://angie.software/news/articles/acme-angie-avtomaticheskii-https Create a directory to store OctoDNS configuration files. ```console $ sudo mkdir /dns-conf ``` -------------------------------- ### Example upstream configuration with resolve and SRV record Source: https://angie.software/configuration/modules/http/http_api An example of an upstream block with a server defined using a service name for SRV record resolution. ```nginx upstream backend { server backend.example.com:8080 service=_example._tcp resolve; server 127.0.0.1:12345; zone backend 1m; } ``` -------------------------------- ### Example upstream configuration with random load balancing Source: https://angie.software/configuration/modules/http/http_api An example of an upstream block configured with the 'random' load balancing method and a server with 'max_conns' parameter. ```nginx upstream backend { zone backend 256k; server backend.example.com resolve max_conns=5; random; } ``` -------------------------------- ### RealIP Configuration Example Source: https://angie.software/adc/docs-0.6.0/configuration_lb/reference/http/http_realip This snippet demonstrates a typical configuration for the RealIP module, including trusted IP sources, the header to use, and recursive resolution settings. ```nginx set_real_ip_from 192.168.1.0/24; set_real_ip_from 192.168.2.1; set_real_ip_from 2001:0db8::/32; real_ip_header X-Forwarded-For; real_ip_recursive on; ``` -------------------------------- ### Example upstream configuration with resolve and SRV record Source: https://angie.software/configuration/modules/http/http_api An example of an upstream block with a server defined using a service name for SRV record resolution, including the 'resolve' directive. ```nginx upstream backend { server backend.example.com service=_http._tcp resolve; server 127.0.0.1; zone backend 1m; } ``` -------------------------------- ### Example uWSGI Temporary File Path Source: https://angie.software/angie/docs/configuration/modules/http/http_uwsgi Illustrates the resulting temporary file path structure based on the `uwsgi_temp_path` configuration. ```nginx /spool/angie/uwsgi_temp/7/45/00000123457 ``` -------------------------------- ### DNS Challenge Handler Example (FastCGI) Source: https://angie.software/adc/docs-0.8.2/configuration_lb/reference/acme Example of configuring a `fastcgi_pass` handler within an `acme_hook` location for DNS-based ACME challenges. ACME variables are passed using `fastcgi_param`. ```nginx location @acme_hook { acme_hook example; fastcgi_pass unix:/var/run/acme-dns.sock; fastcgi_param SCRIPT_FILENAME $document_root; # Pass ACME variables fastcgi_param ACME_HOOK $acme_hook_name; fastcgi_param ACME_CHALLENGE $acme_hook_challenge; fastcgi_param ACME_DOMAIN $acme_hook_domain; fastcgi_param ACME_TOKEN $acme_hook_token; fastcgi_param ACME_KEYAUTH $acme_hook_keyauth; } ``` -------------------------------- ### Custom Output: PID, PPID, Command, Start Time Source: https://angie.software/adc/docs-0.6.0/management/cli-commands Shows the Process ID (PID), Parent Process ID (PPID), command name, and the start time of the process. ```bash ps -o pid,ppid,cmd,start_time ``` -------------------------------- ### HTTP Challenge Handler Example (Proxy Pass) Source: https://angie.software/adc/docs-0.8.2/configuration_lb/reference/acme Example of configuring a `proxy_pass` handler within an `acme_hook` location for HTTP-based ACME challenges. ACME variables are passed using `proxy_set_header`. ```nginx location @acme_hook { acme_hook example; proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # Pass ACME variables proxy_set_header ACME_HOOK $acme_hook_name; proxy_set_header ACME_CHALLENGE $acme_hook_challenge; proxy_set_header ACME_DOMAIN $acme_hook_domain; proxy_set_header ACME_TOKEN $acme_hook_token; proxy_set_header ACME_KEYAUTH $acme_hook_keyauth; } ``` -------------------------------- ### Angie Logging Example Source: https://angie.software/angie/docs/developer_guide Demonstrates setting the log action and using ngx_log_error and ngx_log_debug macros for logging information and debug messages in Angie. ```c /* specify what is currently done */ log->action = "sending mp4 to client"; /* error and debug log */ ngx_log_error(NGX_LOG_INFO, c->log, 0, "client prematurely closed connection"); ngx_log_debug2(NGX_LOG_DEBUG_HTTP, mp4->file.log, 0, "mp4 start:%ui, length:%ui", mp4->start, mp4->length); ``` -------------------------------- ### Configure Angie for NTLS Source: https://angie.software/adc/docs-0.6.0/configuration_lb/reference/stream/stream_proxy Example command to configure Angie compilation with NTLS support, specifying the TongSuo SSL library and its NTLS option. ```bash ./configure --with-openssl=../Tongsuo-8.3.0 \ --with-openssl-opt=enable-ntls \ --with-ntls ``` -------------------------------- ### Retrieve HTTP Configuration Source: https://angie.software/adc/docs/configuration_lb/reference/http/http_api Use the GET method to retrieve configuration entities from the /config path. You can query specific parameters or the entire configuration. Use 'defaults=on' to get default values. ```bash $ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com/max_conns $ curl http://127.0.0.1/config/http/upstreams/backend/servers/backend.example.com $ curl http://127.0.0.1/config/http/upstreams/backend/servers $ # ... $ curl http://127.0.0.1/config ``` ```bash $ curl http://127.0.0.1/config/http/upstreams/backend/servers?defaults=on ``` -------------------------------- ### Angie Configuration Example for VTS Source: https://angie.software/angie/docs/installation/external-modules/vts This Nginx configuration snippet demonstrates how to enable the VTS module, serve the status HTML page, and define a location to display traffic status in JSON format. ```nginx http { # ... vhost_traffic_status_zone; server { listen 80; server_name localhost; root /usr/share/angie/html; index index.html index.htm; location = /status.html { root /usr/share/angie-module-vts; } location /status { vhost_traffic_status_display; vhost_traffic_status_display_format html; } } } ``` -------------------------------- ### Basic Limit Conn Configuration Source: https://angie.software/adc/docs/configuration_lb/reference/http/http_limit_conn This example shows how to limit connections from a single IP address to one per download location. Ensure the `limit_conn_zone` is defined in the http block and the `limit_conn` directive is applied to the desired location. ```nginx http { limit_conn_zone $binary_remote_addr zone=addr:10m; ... server { ... location /download/ { limit_conn addr 1; } } } ``` -------------------------------- ### Disable Symlinks Example Source: https://angie.software/adc/docs-0.7.3/configuration_lb/reference/http/http This example demonstrates how to disable symbolic links in a specific path, using the `on` and `from=` parameters. It ensures that if any component of the path is a symbolic link, access is denied, unless it's within the specified `$document_root`. ```nginx disable_symlinks on from=$document_root; ``` -------------------------------- ### Entering TLS Upload Mode Source: https://angie.software/adc/docs-0.7.3/common-tasks-and-examples/tls Connect to the CLI and enter the certificate configuration and TLS upload modes to prepare for uploading certificate files. ```console cert-config tls-upload ``` -------------------------------- ### Setting SSL Buffer Size Source: https://angie.software/adc/docs-0.7.3/configuration_lb/reference/http/http_ssl This example demonstrates how to configure the buffer size for SSL data transmission. A smaller buffer size can help reduce the Time To First Byte for large responses. ```nginx ssl_buffer_size 4k; ``` -------------------------------- ### Demonstrate Unbrotli Decompression Source: https://angie.software/angie/docs/installation/external-modules/unbrotli This example shows how to test the unbrotli module's decompression. When a client does not support Brotli, the module decompresses the file on the server before sending it. ```bash $ curl -s -o tmp/war-and-peace.txt localhost/storage/war-and-peace.txt $ ls -l tmp/ total 3284 -rw-r--r-- 1 asv asv 3359405 Feb 27 16:39 war-and-peace.txt ``` -------------------------------- ### Angie GeoIP2 Configuration Example Source: https://angie.software/angie/docs/installation/external-modules/geoip2 Configure the GeoIP2 module to use a GeoLite2-Country database, set auto-reloading, and define variables for country code and name based on the X-Forwarded-For header. This example also includes a map for access control and a custom log format. ```nginx http { geoip2 /var/lib/GeoIP/GeoLite2-Country.mmdb { auto_reload 1h; $geoip2_country_code default=RU source=$http_x_forwarded_for country iso_code; $geoip2_country_name source=$http_x_forwarded_for country names ru; } log_format with_geoip '$server_port $remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" "$http_host" ' 'country="$geoip2_country_code"'; map $geoip2_country_code $denied { PL "1"; QA "1"; } server { listen 80; root /usr/share/angie/html; index index.html index.htm; access_log /var/log/angie/geoip_access.log with_geoip; if ($denied) { return 403; } location / { echo "ip = $http_x_forwarded_for"; echo "code = $geoip2_country_code"; echo "name = $geoip2_country_name"; } } } ``` -------------------------------- ### CLI Command Syntax Source: https://angie.software/adc/docs-0.8.2/management/cli-commands Illustrates the general syntax for CLI commands, including mandatory and optional parameters, and user input. ```none command option0 {option1|option2|...|option N} [option3] [{option4|option5|...|option M}] [option6 ] [] ```