Objective
This article describes how to deploy an ASP. NET Core 2.0 Web project on an Ubuntu 16.04 server.
To install the. NET core enrollment Microsoft signing key:
curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpgsudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg
Registering a software source
sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'
Installing the. NET SDK
Under terminal Manager, run the following command:
sudo apt-get updatesudo apt-get install dotnet-sdk-2.0.2
Installation and startup update source for Nginx
sudo apt-get update
Installing Nginx
sudo apt-get install nginx
Start Nginx
Explicitly start by running the following command:
sudo service nginx start
Configure Nginx
server { listen 80; location / { proxy_pass http://localhost:8000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection keep-alive; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }}
Reference articles
1. Use Nginx to set up a managed Environment for ASP. NET Core and deploy it on Linux
2.Get started with. NET in minutes
Use Nginx to deploy. NET Core 2.0 sites under Ubuntu