Appendix B. Deploying to production
This appendix runs through the main options for running the microservices you develop throughout the book in a production environment. The main factor that affects where and how you can deploy the microservices is that they’re based on .NET Core.
The microservices I discuss include two kinds of processes: HTTP APIs and event consumers. The HTTP APIs are based on ASP.NET Core and therefore run on top of Kestrel; the event consumers are .NET Core console applications.
Because .NET Core runs on both Windows and Linux, so can your microservices. Likewise, your microservices can run on your own servers or in the cloud—either Amazon or Azure.
All the HTTP APIs in this book’s microservices are built in Nancy and run on top of ASP.NET Core. That means they run on top of the Kestrel web server. Kestrel isn’t a full-featured web server; rather, it’s a small, fast web server geared toward serving dynamic content from ASP.NET Core. The recommended way to use Kestrel in a production environment is to place it behind a reverse proxy. The reverse proxy can handle things that Kestrel isn’t well suited for—like serving static files, SSL termination, and response compression. The setup is as shown in figure B.1 on Windows or Linux.