I haven't gotten .Net Core for a long time, and then I suddenly found that the Hyper-V virtual machine that comes with Windows seems to be very useful
.Net Core used Jexus as the server before, and suddenly wanted to try it with Nginx
1. Install .Net Core SDK in CentOS 7
sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm sudo yum update sudo yum install libunwind libicu sudo yum install dotnet-sdk-2.1.105
2. Create a new .NET Core project
dotnet new razor -o aspnetcoreapp cd aspnetcoreapp dotnet run
// To add the CentOS 7 EPEL repository, open a terminal and use the following command: sudo yum install epel- release // Now that the Nginx repository is installed on your server, install Nginx using the following yum command sudo yum install nginx // Nginx will not start by itself. To run Nginx, enter sudo systemctl start nginx // If you are running a firewall, run the following commands to allow HTTP and HTTPS communication sudo firewall-cmd --permanent --zone= public --add-service= http sudo firewall-cmd --permanent --zone=public --add-service=https sudo firewall-cmd --reload // If you want to enable Nginx at system startup. Please enter the following command sudo systemctl enable nginx
If you can see the welcome page of Nginx using IP access, it means that Nginx is installed successfully
// Find the Nginx installation configuration file cd /etc/nginx/ // Edit the configuration file vi nginx.conf // Find the server node under http // Modify server_name to Ip address or domain name eg:192.168.1.222 // Modify location / {proxy_pass http://localhost :5000;} // Save and exit Esc :wq! // Restart Nginx nginx -s reload
5. Access using 192.168.1.222
Of course, this is just to make the website run, and there are still many configurations that need to be explored. . .