<div dir="ltr"><div>I have bumped into CGI (after asking the question here). <br></div><div><br></div><div>However, I have some issues with CGI. For example, I have to add HEADERS maintaining CRLF etc in the output. However, I want the CLI app to be totally independent. I mean, I want to output regular text or json without any header. So, what I really want is:</div><div><br></div><div>CLI_APP | ADD_UI | ADD_CGI_HEADER<br></div><div><br></div><div>Where CLI_APP gives me pure json. ADD_UI adds HTML, CSS, JS on the json output. And ADD_CGI_HEADER adds the extra stuff that is needed to make the final response sendable via the server.</div><div><br></div><div>Please note that when the user will send a request, it will have to go through the total pipeline. Also please note that, I can always call ADD_UI at the end of CLI_APP and call ADD_CGI_HEADER at the end of ADD_UI. But that way, I am not decoupling. And the later binaries will be dependent on the previous ones. This is not something I want. I want to <b>pipe the outputs to get the final response</b>.</div><div><br></div><div>How can I do that? Do I need to extend nginx in any way (like creating any module or something like that)? Or is there already a solution i do not know about?</div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><b style="font-weight:normal"><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Thanks and Best Regards,</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt"><span style="font-size:10pt;font-family:Arial;color:rgb(0,0,0);background-color:transparent;font-weight:400;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline;white-space:pre-wrap">Ahmad Ismail</span></p></b></div></div></div><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 22, 2022 at 11:24 PM Lyndon Nerenberg (VE7TFX/VE6BBM) <<a href="mailto:lyndon@orthanc.ca">lyndon@orthanc.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Ahmad Ismail writes:<br>
<br>
> Can Nginx help me send the requests to CLI_APP via STDIN and serve the<br>
> final output of ADD_UI --output web?<br>
<br>
I think what you're looking for here is inetd.<br>
<br>
--lyndon<br>
</blockquote></div>