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:

mkdir MusicLive

Then I clone repo to that place

cd MusicLive
git clone

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

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>.<>

server {
    listen 80;

    server_name <live>.<>;

    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>.<>

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

Leave a Comment

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *