DotNet Core部署完成后,通过IP访问设置

Net Core 默认创建的项目部署完成以后,只能在本机内访问,外部通过IP是打不开的,可以通过配置Nginx实现。也可以通过修改Program.cs

 

var host = new WebHostBuilder()
     .UseKestrel()
     .UseUrls("http://*:5000")
     .UseContentRoot(Directory.GetCurrentDirectory())
     .UseIISIntegration()
     .UseStartup()
     .Build();
 
host.Run();
 
UseUrls(http://*:5000) 即可实现通过IP访问程序。

转载于:https://www.cnblogs.com/zhangj391/p/6648841.html

你可能感兴趣的:(DotNet Core部署完成后,通过IP访问设置)