zoukankan      html  css  js  c++  java
  • Linux下Nginx负载 iis问题

    使用以下NGINX配置负载IIS

    upstream 192.168.119.128{

        server 192.168.119.1:8081;

        server 192.168.119.1:8082;

    }

    server{

        listen   80;

        server_name  192.168.119.128;

        location /{

            proxy_pass   http://192.168.119.128;

        }

       

    }

    需要以下操作

    1. 关闭CentOS防火墙

    虚拟机里nginx可以访问,但外部不能访问,解决方法:

    vim /etc/sysconfig/iptables

    添加

    -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT

    然后执行(即时生效,重启失效):

    service iptables stop

    service iptables start

    重启后生效

    chkconfig iptabels on

    chkconfig iptabels off

    1. CentOS下查看SeLinux状态及关闭SeLinux

    查看SELinux状态:

    1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

    SELinux status:                 enabled

    2、getenforce                 ##也可以用这个命令检查

    关闭SELinux:

    1、临时关闭(不用重启机器):

    setenforce 0                  ##设置SELinux 成为permissive模式

    ##setenforce 1 设置SELinux 成为enforcing模式

    2、修改配置文件需要重启机器:

    修改/etc/selinux/config 文件

    将SELINUX=enforcing改为SELINUX=disabled

    重启机器即可

    安装 iptables-services

    With RHEL 7 / CentOS 7, firewalld was introduced to manage iptables. IMHO, firewalld is more suited for workstations than for server environments.

    It is possible to go back to a more classic iptables setup. First, stop and mask the firewalld service:
     

    systemctl stop firewalld
    systemctl mask firewalld
    

    Then, install the iptables-services package:

    yum install iptables-services
    

    Enable the service at boot-time:

    systemctl enable iptables
    

    Managing the service

    systemctl [stop|start|restart] iptables
    

    Saving your firewall rules can be done as follows:

    service iptables save
    

    or

    /usr/libexec/iptables/iptables.init save
  • 相关阅读:
    js01
    js---18miniJquery
    js---17继承中方法属性的重写
    js---16继承
    js---16原型链
    js---15深拷贝浅拷贝 原型链
    js---14公有私有成员方法
    js---13 this call apply
    js---12对象创建方式,构造器,原型
    ESXi导出的CentOS7 ovf文件导入到workstation 无法打开GUI登录界面的问题解决方案
  • 原文地址:https://www.cnblogs.com/kick/p/6254212.html
Copyright © 2011-2022 走看看