简体   繁体   English

Azure + Ubuntu VM +端点

[英]Azure + Ubuntu VM + Endpoints

I am able to SSH into my Azure VM. 我可以通过SSH进入我的Azure VM。 However, neither NGINX on port 80 nor dockerized ASP.NET Core on port 5000 are accessible. 但是,端口80上的NGINX或端口5000上的dockerized ASP.NET Core均不可访问。 I've added security endpoint "allow" in the Azure portal config. 我在Azure门户配置中添加了安全终结点“允许”。

From within SSH session, using lynx to access localhost:80 and localhost:5000 works as expected 在SSH会话中,使用lynx访问localhost:80和localhost:5000可以正常工作

Docker container starting with: Docker容器以:

docker run -t --rm -p 5000:5000 *imagename*

I attempted to modify IPTABLES with this recommendation apache not accepting incoming connections from outside of localhost but doing so still shows "0 pkts" when doing iptables -vL 我尝试使用此推荐的apache修改IPTABLES,但不接受来自localhost外部的传入连接,但在执行iptables -vL时仍显示“ 0 pkts”

Screenshot of the Azure rule configuration: Azure规则配置的屏幕截图:

Azure入站规则

I've also added the port 80 outbound rule as Rem has suggested, but so far this has not helped. 我还按照Rem的建议添加了80端口出站规则,但是到目前为止,这没有帮助。

Finally found the answer. 终于找到答案了。

在此处输入图片说明

Circled area (source port range) I had as 80. Setting this instead to * solves the issue and now external connections to 80 work. 圈出的区域(源端口范围)为80。将其设置为*可以解决问题,现在可以将外部连接设置为80。 5000 still does not, but I expect that's a docker binding issue as Neil suggests and I'm specifically using nginx to proxy the docker container anyway. 5000仍然没有,但我希望这是Neil建议的docker绑定问题,无论如何,我特别使用nginx代理Docker容器。

Inside your Azure VM setting you should go to Network Security group -> and set Inbound security rules like this: 在您的Azure VM设置中,您应该转到Network Security组->并设置入站安全规则,如下所示:

1000 default-allow-ssh Any Any SSH (TCP/22) Allow
…
1010 web Any Any HTTP (TCP/80) Allow
1020 web Any Any HTTP (TCP/5000) Allow
…

I also has outbound security rules: 我也有出站安全规则:

  100 http Any Any Custom (ANY/80) Allow
…

Nginx和您的docker容器是否绑定在localhost或0.0.0.0或其他网络接口上?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM