Deploy the application

    Because ASP.NET Core applications can run on Windows, Mac, or Linux, there are a number of different ways you can deploy your application. In this chapter, I’ll show you the most common (and easiest) ways to go live.

    ASP.NET Core applications are typically deployed to one of these environments:

    • Linux (with Nginx). If you don’t want to go the Docker route, you can still host your application on any Linux server (this includes Amazon EC2 and DigitalOcean virtual machines). It’s typical to pair ASP.NET Core with the Nginx reverse proxy. (More about Nginx below.)

    Kestrel and reverse proxies

    ASP.NET Core includes a fast, lightweight development web server called Kestrel. It’s the server you’ve been using every time you ran the app locally and browsed to . When you deploy your application to a production environment, it’ll still use Kestrel behind the scenes. However, it’s recommended that you put a reverse proxy in front of Kestrel, because Kestrel doesn’t yet have load balancing and other features that bigger web servers have.

    If you’re using Azure to host your application, this is all taken care of for you automatically. I’ll cover setting up Nginx as a reverse proxy in the Docker section.