Nginx and Astra

    Nginx is an HTTP server and reverse proxy that can be used in conjunction with Astra to offload its http server.

    http://address:port - address to original Astra process. /ramcache - directory for cache. Mount it with the command:
    mount -t tmpfs tmpfs /ramcache

    Nginx virtual host configuration file:

    server {
        listen 30000;
        server_name _;
    
        location / {
            root /ramcache;
            try_files $request_uri @proxy_origin;
        }
        location ~* \.(m3u8)$ {
            proxy_cache off;
            expires -1;
            proxy_pass http://address:port;
        }
        location ~* \.(ts|trp)$ {
            root /ramcache;
            try_files $request_uri @proxy_origin;
        }
        location @proxy_origin {
            resolver 8.8.8.8;
            proxy_pass http://address:port;
            proxy_temp_path "/ramcache/tmp";
            proxy_store "/ramcache/$request_uri";
            proxy_store_access user:rw group:rw all:r;
            proxy_method GET;
            proxy_set_header     Host $host;
        }
    }
    
    

    in the Astra Settings, check the box Use Expires header