Deploy ASP.NET App on Linux with NGINX | Chatting App | Code First | MSSQL
#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/ubuntu/20.04/packages-microsoft-prod.deb
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]