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



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

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]