Set up .NET Core project in Linux with Nginx [Music no 9]

This post is continuation of previous one.

I created new folder where I’ll have production code:

cd
mkdir MusicLive

Then I clone repo to that place

cd MusicLive
git clone https://github.com/Jaryn91/Music.git

I use User Secrets approach. So I need to create specific folder and copy there my secrect.josn

cd
mkdir -p .microsoft/usersecrets/79c7fe53-1b92-4bc2-ad7e-318e817f92c9
cd .microsoft/usersecrets/79c7fe53-1b92-4bc2-ad7e-318e817f92c9

To run my application I go to specific folder and just run it :).

cd ~/MusicLive/Music/Musiction.API/Musiction.API
sudo dotnet run env=prod

I added file /etc/nginx/site-available/<live>.<mywebsite.com>

server {
    listen 80;

    server_name <live>.<mywebsite.com>;

    location / {
        proxy_pass http://localhost:5050;
        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;
    }
}

I added file /etc/nginx/site-enabled/<live>.<mywebsite.com>

sudo ln -s /etc/nginx/sites-available/<live>.<mywebsite.com> /etc/nginx/sites-enabled/

Leave a Comment

Twój adres email nie zostanie opublikowany. Pola, których wypełnienie jest wymagane, są oznaczone symbolem *