Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does ASP.NET 5 on Linux require kestrel?

I am trying to understand the entire web/framework/application stack when installing ASP.NET 5 on Linux.

All the instructions I have read, including this one haven't really answered my question:

Why can't Nginx server work without Kestrel like here: http://www.mono-project.com/docs/web/fastcgi/nginx/ ?

Or am I way off. I'm trying to understand what the reason is for this structure:

.NET Core(or mono) --> Kestrel --> Nginx

Isn't Kestrel just another web server like Nginx but with a lot less features?

like image 674
Freeman Helmuth Avatar asked Sep 03 '15 05:09

Freeman Helmuth


2 Answers

ASP.NET Core (ASP.Net 5) doesn't require Kestrel!

You're right, Kestrel is just a simple HTTP server with a small set of features. You can run ASP.NET Core without Kestrel on Linux or Mac, but you must either have an HTTP server or a fastCGI server.

Nginx is used as a reverse proxy for static contents in general and you can also enable gzip compression on your dynamic content. Kestrel doesn't have this feature.

You can also write your own HTTP server with the specific HTTP features you need (HTTP2 for example).

like image 150
agua from mars Avatar answered Nov 15 '22 15:11

agua from mars


Necromancing.

Yes, it does in fact require Kestrell.
As Agua says, theoretically, it could also be run on some other http-server than Kestrell, one that can run .NET Core, or via FastCGI.

However, AFAIK, Kestrell is the only http-server currently in existance that can actually do that.
And because AFAIK, a FastCGI-server/library written in .NET Core doesn't (yet) exist.

Right now, if you want to use .NET Core with nginx or Apache, all you can do is to reverse-proxy requests to kestrell.

like image 28
Stefan Steiger Avatar answered Nov 15 '22 14:11

Stefan Steiger