It’s best practice for ASP.NET Core applications to have a “real” webserver in front of them. We’ll configure NGINX for the job using Ansible. We don’t hate all best practices. ASP.NET Core applications have a built-in webserver called Kestrel. This internal webserver is not intended to serve requests directly. It must be placed behind a production quality webserver such as NGINX, IIS, etc. We chose NGINX because we have experience with it and it runs on Linux. Ansible does all the needed configuration and keeps our servers consistent and predictable.
Configure NGINX with Ansible
Everything we need can be accomplished from a single playbook. This playbook installs NGINX, configures it, copies SSL keys and enables the ASP.NET Core site:
That’s it! NGINX can now serve production traffic and reverse proxy to our ASP.NET Core application. The ASP.NET Core application is run manually from an SSH session to check that NGINX is working. Next we’ll remove this manual step by using systemd to run our ASP.NET Core application automatically.
Long animation frames (LoAFs) make your website feel slow and laggy, but we’re here to help you fix that. Learn how to track, analyze, and optimize your LoAF...
Read more »
Long animation frames (LoAFs) can leave your website feeling slow and unresponsive. Learn about Long Animation Frames,
what they are, and how to measure them.
Read more »
Everyone in web performance talks about CrUX—what the heck is it?! CrUX, or the Chrome User Experience Report, is Google’s initiative to measure how websites...
Read more »