        location /get_scpi_status {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            
            default_type application/json;

            content_by_lua '
                local f = io.popen("systemctl is-active redpitaya_scpi.service")
                local content = f:read("*all") 
                f:close() 
                ngx.say(content) 
            ';
        }

        location /start_scpi_manager {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            
            default_type application/json;

            content_by_lua '
                local f = io.popen("systemctl start redpitaya_scpi.service")
                f:close() 
                ngx.say("OK") 
            ';
        }

        location /stop_scpi_manager {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            
            default_type application/json;

            content_by_lua '
                local f = io.popen("systemctl stop redpitaya_scpi.service")
                f:close() 
                ngx.say("OK")  
            ';
        }





        location /get_ip {
            add_header 'Access-Control-Allow-Origin' '*';
            add_header 'Access-Control-Allow-Credentials' 'true';
            add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
            add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
            
            default_type application/json;

            content_by_lua '
                local eth = io.popen("ip -4 addr list eth0") 
                local wlan = io.popen("ip -4 addr list wlan0") 
                local eth_content = eth:read("*all") 
                local wlan_content = wlan:read("*all") 
                eth:close() 
                wlan:close() 
                ngx.say(eth_content..";"..wlan_content)
            ';
        }
