Deploy ASP.NET App on Linux with NGINX | Chatting App | Code First | MSSQL

Опубликовано: 30 Октябрь 2024
на канале: Dot Net Tech
2,572
18

#dotnet #programming #webdevelopment
Deploying an ASP.NET Core application on a Linux server with NGINX as the reverse proxy is a common approach to host web applications built using the ASP.NET Core framework. ASP.NET Core is a cross-platform framework that allows developers to build and run applications on various operating systems, including Windows, macOS, and Linux. NGINX, on the other hand, is a high-performance web server and reverse proxy that is known for its efficiency and reliability.

Here’s a high-level overview of the process:
💻 01 Install the .NET Core Runtime on the server
wget https://packages.microsoft.com/config...
sudo dpkg -i packages-microsoft-prod.deb

sudo apt update
sudo apt install apt-transport-https
sudo apt install dotnet-sdk-6.0

💻 02: Check Dotnet Vertion Now
dotnet --version

💻 03: Install Nginx on the server
sudo apt update
sudo apt install nginx
systemctl status nginx


💻 04 Publish app from VS Code
dotnet publish -c Release -r linux-x64 --self-contained true
cd /var/www/RealTimeChatApp

💻 4.1 Copy Files to the Server:
scp -r bin/Release/netcoreapp3.1/linux-x64/publish/* user@server_ip:/path/to/destination


#05 Configure Nginx
/etc/nginx/sites-available

For example, create a file named myapp with the following content:

server {
listen 80;
server_name mydomain.com;

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

💻 06 Replace mydomain.com with your actual domain or server IP address.
💻 07 Create a symbolic link to enable the site configuration:
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/

Replace user, server_ip, and /path/to/destination with the appropriate values.

💻 08 Managing the Nginx Process
sudo systemctl stop nginx
sudo systemctl start nginx
sudo systemctl restart nginx
sudo systemctl reload nginx
sudo systemctl disable nginx
sudo systemctl enable nginx

💻 09 Run the Application
🚀 Live Demo:
User Name: [email protected] Password: 123
Web: http://94.100.26.129:89/Account/Login


👋 Complete Project Using ASP.NET Core
✅ Business ERP Solution/Product/POS/Company Management:
https://1.envato.market/AoMzyj

✅ School/College/University Management ERP:
https://1.envato.market/15NBrd

✅ Dashboard Template | ASP.NET Core MVC Web Starter Kit
https://1.envato.market/JrEGWa

✅ Advance POS System with Stock Manager | ASP.NET Core | EF Core | .NET Core 6.0:
https://1.envato.market/9WQxbW

✅ Asset Management System with Barcode | ASP.NET Core | EF Core | .NET Core 6.0:
https://1.envato.market/qnNkey

✅ Advanced Files & Users Management | ASP.NET Core | EF Core | .NET Core | MSSQL | MySQL:
https://1.envato.market/DVaRBq

✅ Hospital and Pharmacy Management System | ASP.NET Core | EF Core:
https://1.envato.market/OR5o6N

✅ Inventory and User Management System:
https://1.envato.market/jW221P

✅ Invoice Gen(Invoice Generation and Management) using .Net Core and EF:
https://1.envato.market/0JOOm3

✅ Complaint | Issue | Helpdesk Ticket | My Ticket HelpDesk Support System | ASP.NET Core | EF Core:
https://1.envato.market/MXjj5P

✅ User Management:
https://1.envato.market/WDE2JO

✅ ASP.NET Core CRUD Operation Using Dot Net 6.0 | MVC| MSSQL | MySQL | EF Core Code First | jQuery
https://1.envato.market/b3Yeg9

✅ ASP.NET Core full CRUD with .NET 5 | MSSQL/MySQL | EF code first:
https://1.envato.market/OR551W

✅ Staff | Employee Leave Management System
https://1.envato.market/rnjYzd

✅ Library Management System | ASP.NET Core | MSSQL | Code First
https://1.envato.market/YgWWgR

✅ ASP.NET REST API Template Starter Kit
https://1.envato.market/5gMzDn


🚀 If you want to modify or add new features, you can always contact us at,
WhatsApp: 8801674411603
Telegram: shahed71bd
Skype: shahedatomap
Email: [email protected]