1、使用該執行打開端口文件
vi /etc/sysconfig/iptables
2、隨便復制一行現有內容,將你要打開的端口設置上就行了,這里是打開80端口
-A INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
3、輸入:wq保存退出
4、service iptables restart,使設置生效
參考:https://zhidao.baidu.com/question/646656030269651725.html
查找nginx安裝路徑 find / -name nginx