0
我有2个服务器,一个nginx/PHP和一个mongoDB服务器。我已经正确配置了mongoDB服务器的iptables,并且可以在防火墙关闭时使用nginx服务器连接到它。但是,当我打开防火墙时。它停止工作。应用服务器上应该打开什么来连接到MongoDB?MongoDB应用服务器IPTables
我在我的mongo数据库服务器上使用了默认端口。这是我的Web服务器上的iptables输出。
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- { MongDB IP } anywhere tcp dpt:27017
ACCEPT tcp -- anywhere anywhere tcp dpt:http state NEW,ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp dpt:https state NEW,ESTABLISHED
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere { MongDB IP } tcp spt:27017
ACCEPT tcp -- anywhere anywhere tcp spt:http state ESTABLISHED
ACCEPT tcp -- anywhere anywhere tcp spt:https state ESTABLISHED
查看上面的我的iptables – user1978109