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
  • 相关阅读:
    领会一些比较巧妙的算法
    操作系统os常识
    C++中的继承与虚函数各种概念
    我学shell程序的记录
    matlab:linux环境中将m文件编译成动态链接库
    struct内存对齐:gcc与VC的差别
    fedora中丢失或损坏fstab,无法启动,如何补救
    判断一个字符串中的字符是否都在另一个中出现
    linux下的不错的小软件:apvlv,zathura和vifm
    C语言中将结构体写入文件
  • 原文地址:https://www.cnblogs.com/kick/p/6254212.html
Copyright © 2011-2022 走看看