zoukankan      html  css  js  c++  java
  • nginx开启后主机无法访问虚拟机的nginx解决方案

    如果IP可以通的话 一般是防火墙引起

    方法1、cat /etc/sysconfig/iptables

    # Generated by iptables-save v1.4.7 on Fri Nov 18 01:51:49 2016
    *filter
    :INPUT ACCEPT [0:0]
    :FORWARD ACCEPT [0:0]
    :OUTPUT ACCEPT [40:3968]
    -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT 
    -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT 
    -A INPUT -p icmp -j ACCEPT 
    -A INPUT -i lo -j ACCEPT 
    -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT 
    -A INPUT -j REJECT --reject-with icmp-host-prohibited 
    -A FORWARD -j REJECT --reject-with icmp-host-prohibited 
    COMMIT

    -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT

    方法2、

    [root@localhost ]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT
    [root@localhost ]# /etc/init.d/iptables save
    [root@localhost ]# /etc/init.d/iptables restart

    2

  • 相关阅读:
    Linux内核编译
    Linux系统启动流程(2)
    Linux系统启动流程及grub重建(1)
    shell函数
    css基础
    前端之练习抽屉首页
    css简单分页
    mysql索引提高查询速度
    html基础
    博客园css样式代码
  • 原文地址:https://www.cnblogs.com/yomho/p/6074815.html
Copyright © 2011-2022 走看看