Use Nginx to deploy. NET Core 2.0 sites under Ubuntu

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.