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;
}
}
需要以下操作
- 关闭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
- 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
Linux下Nginx负载 iis问题的更多相关文章
- linux下nginx负载均衡部署
nginx负载均衡部署 Nginx("engine x") 是一个高性能的 HTTP 和 反向代理 server,也是一个 IMAP/POP3/SMTP 代理server. Ngi ...
- linux下nginx负载均衡搭建
[一.Nginx能做什么] 1.http服务器.Nginx是一个http服务可以独立提供http服务.可以做网页静态服务器. 2.虚拟主机.可以实现在一台服务器虚拟出多个网站.例如个人网路使用的虚拟主 ...
- VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三)
首先启动Nginx 1. 相关浏览 两个 Tomcat 配置: VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二) Nginx 安装配置启动: VMware Linu ...
- VMware Linux 下 Nginx
负载 VMware Linux 下 Nginx 安装配置 - nginx.conf 配置 [负载两个 Tomcat] (三) Weiseditor 2014-11-26 23:42 阅读:1 评论 ...
- Linux下nginx编译安装教程和编译参数详解
这篇文章主要介绍了Linux下nginx编译安装教程和编译参数详解,需要的朋友可以参考下 一.必要软件准备1.安装pcre 为了支持rewrite功能,我们需要安装pcre 复制代码代码如下: # y ...
- 【转】Linux下nginx配置https协议访问的方法
一.配置nginx支持https协议访问,需要在编译安装nginx的时候添加相应的模块--with-http_ssl_module 查看nginx编译参数:/usr/local/nginx/sbin/ ...
- VMware Linux 下 Nginx 安装配置 - Tomcat 配置 (二)
准备工作 相关浏览: VMware Linux 下 Nginx 安装配置 (一) 1. 选在 /usr/local/ 下创建 softs 文件夹,通过 ftp 命令 把 apache-tomcat-7 ...
- linux下nginx+php+mysql 自助环境搭建
++++++++++++++++++++++++++++++++++++++++++++++linux下nginx+php+mysql环境搭建+++++++++++++++++++++++++++++ ...
- linux下nginx结合keepalived实现主从切换的配置
linux下nginx结合keepalived实现主从切换的配置 解决方法: 实现一个主nginx宕机,请求转到另一个nginx中. 1.确保两台nginx已启动,假如端口分别是192.168.0 ...
随机推荐
- ADT - Eclipse 常用快捷键
ADT - Eclipse 常用快捷键 Alt + / : 自动补全 F3 : 打开类的源码 Ctrl + D : 删除选中行 Ctrl + 1 : 自动弹出修改建议 Ctrl + Shift + J ...
- 长按TextField或TextView显示中文的粘贴复制
首先要确保手机当前系统为中文,只需要在 plist 文件中添加 Localized resources can be mixed = YES 就行了
- iOS面试题 -总结 ,你的基础扎实吗?
1.#import和#include的区别,@class代表什么? (1)#import指令是Object-C针对#include的改进版本,#import确保引用的文件只会被引用一次,这样你就不会陷 ...
- iOS 下拉刷新-上拉加载原理
前言 讲下拉刷新及上拉加载之前先给大家解释UIScrollView的几个属性 contentSize是UIScrollView可以滚动的区域. contentOfinset 苹果官方文档的解释是&qu ...
- SQLite使用(三)&&核心API使用
概述 SQLite提供了一系列接口供用户访问数据库,主要包括连接数据库,处理SQL,迭代查询结果等.本文会针对我们使用SQLite的主要场景,列出核心的API,详细介绍API的用法并给出代码用 ...
- lnmp 预设iptables设置
「LNMP」iptables初始配置 首先使用命令iptables -P INPUT ACCEPT允许所有连接,否则容易把自己关在外边.然后使用iptables -F;iptables -X;ip ...
- shell两数之间的算术运算
#!/bin/bash read -p "请输入第一个数:" a read -p "请输入第二个数:" b echo "$a+$b=$[$a+$b]& ...
- 不透明度opacity进阶
一.opacity属性 1.opacity 习惯上说“透明度”,其实应该叫“不透明度”.opacity 意思:不透明,而背景色的默认值:transparent意思才是“透明的”.所以opacity用来 ...
- grub2配置显示系统选择菜单(ubuntu 14.04)
背景: 有一次遇到过安装的新的内核后,ubuntu并没有显示选择内核的grub菜单,按shift键才会弹出,有时候shift按得不准就又进入了不是想进入的那个系统. 配置方法: sudo vim /e ...
- [LeetCode] Gas Station 加油站问题
There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You ...