<div dir="ltr">Dear Sergey Osokin,<div><br></div><div>Thank you very much for the kind response. That is enough to get me started.</div><div><br clear="all"><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></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 21, 2021 at 7:35 PM Sergey A. Osokin <<a href="mailto:osa@freebsd.org.ru">osa@freebsd.org.ru</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">Hi Ahmad,<br>
<br>
hope you're doing well these days.<br>
<br>
On Thu, Oct 21, 2021 at 11:54:05AM +0600, Ahmad Ismail wrote:<br>
> I asked After Nginx Unit, Do we still need ASGI like Uvicorn, Hypercorn,<br>
> Daphne etc <<a href="https://stackoverflow.com/q/69642063/1772898" rel="noreferrer" target="_blank">https://stackoverflow.com/q/69642063/1772898</a>><br>
> <br>
> There one comment confused me. The comment says:<br>
> <br>
> nginx unit is an ASGI compliant server; you're replacing<br>
> > uvicorn/hypercorn/daphne/etc. with nginx unit instead. It's a choice you<br>
> > make just like you'd make using either of those three or other alternatives.<br>
<br>
Well, unicorn/Hypercorn/Daphnie are Asynchronous Server Gateway Interface<br>
(ASGI) servers, so it's possible to run an ASGI application with any of<br>
them.<br>
<br>
It's also true that NGINX Unit is an ASGI server, so it's also possible to run<br>
the same ASGI application on top of NGINX Unit.<br>
<br>
> I am not understanding what it means. Does it mean, I have to install both<br>
> nginx and nginx unit where nginx unit is the replacement for uvicorn /<br>
> hypercorn / daphne etc. Or, nginx unit alone can do what nginx + uvicorn /<br>
> hypercorn / daphne etc. does.<br>
<br>
An answer for the question how to run an application in an evnronment<br>
definitely depends on an application and its architecture.  The list of<br>
questions here starts from the following:<br>
<br>
- does the application needs caching?<br>
- does the application needs to work with FQDNs or IP addresses?<br>
- does the application needs a session persistance?<br>
- TLS termination on a frontend (NGINX) or backend (NGINX Unit)?<br>
- load balancing<br>
<br>
and so on.<br>
<br>
> I asked the same question on FastAPI<br>
> <<a href="https://github.com/tiangolo/fastapi/issues/3128#issuecomment-947391963" rel="noreferrer" target="_blank">https://github.com/tiangolo/fastapi/issues/3128#issuecomment-947391963</a>><br>
> github repo<br>
> <<a href="https://github.com/tiangolo/fastapi/issues/3128#issuecomment-947391963" rel="noreferrer" target="_blank">https://github.com/tiangolo/fastapi/issues/3128#issuecomment-947391963</a>>.<br>
> There one part of the answer is unclear to me.<br>
> <br>
> > But, but, you will probably need https anyway, I personally prefer some<br>
> > proxy, I didn't even try Nginx Unit "way" of applying tls but there is one<br>
> > apparently. Nginx Ingress, traefik for k8s, nginx proxy manager for swarm,<br>
> > alone traefik docker image or full nginx, probably tens of other solutions.<br>
><br>
> What I understood is I need to do few more things after installing nginx<br>
> unit. However, the above quote is not clear to me. Can anyone please<br>
> explain what he meant by it. And do I need to install other stuff after<br>
> installing nginx unit?<br>
<br>
It's easy to start to work with NGINX Unit, deploy an application and see<br>
how it works.  In case you need an additional functionality, it's possible<br>
to extend that with NGINX in front.<br>
<br>
Hope it's clear.<br>
<br>
-- <br>
Sergey Osokin<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" rel="noreferrer" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</blockquote></div>