【发布时间】:2021-12-06 20:00:24
【问题描述】:
我正在尝试按照微软文档在 Unbutu 上部署我的网络应用程序: https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/linux-nginx?view=aspnetcore-5.0
当我在服务器上添加我的应用程序并运行它时,一切看起来都能正常工作:
netstat -a -n 显示:
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:5001 0.0.0.0:* LISTEN
我没有忘记在 My BlazorApp.Server 的 Properties/launchSettings.json 文件中删除:https://localhost:5001;。
当我尝试访问 "http://Myserver":5000 或 5001 时,我不断得到
ERR_CONNECTION_REFUSED
有什么建议吗? 我试图修改设置以允许 chrome 上的不安全内容。 重复教程。
编辑:
- 我尝试了新项目,同样的错误。
- 禁用所有对 chrome 的保护。
- 禁用 Windows Defender。
curl -v "ServerIp":5000 返回:
connect to "ServerIp" port 5000 failed : Connection refused
sudo netstat -tlnp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:5000 0.0.0.0:* LISTEN 1415/dotnet
tcp 0 0 127.0.0.1:5001 0.0.0.0:* LISTEN 1415/dotnet
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 1067/systemd-resolv
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 313/sshd: /usr/sbin
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 573/exim4
tcp6 0 0 ::1:5000 :::* LISTEN 1415/dotnet
tcp6 0 0 ::1:5001 :::* LISTEN 1415/dotnet
tcp6 0 0 :::80 :::* LISTEN 278/apache2
tcp6 0 0 :::22 :::* LISTEN 313/sshd: /usr/sbin
tcp6 0 0 ::1:25 :::* LISTEN 573/exim4
【问题讨论】:
标签: asp.net linux ubuntu server blazor