nginx简单负载均衡设置
来源:互联网 发布:进度网络计划图 编辑:程序博客网 时间:2024/05/21 22:44
## 安装步骤
* 1.到官网下载最新win版本
连接:http://nginx.org/en/download.html
* 2.安装到E文目录 我的E:\nginx-1.7.8
* 3.进入安装目录 E:\nginx-1.7.8\conf\nginx.conf
修改配置
* 4.启动nginx.exe
###常用nginx命令:
nginx -h 帮助
nginx -s stop fast shutdown
nginx -s quit graceful shutdown
nginx -s reload
简单补充下,配置之后出现webservice服务不能使用,加了个参数就ok了
proxy_redirect default;
---
###常用配置注释
upstream 表示配置负载的多个服务器地址
location表示入口参数
server.listen 80 表示监听80端口
server.server_name 表示监听的域名,也可以是ip
---
我的配置如下:
``` java
#user nobody;
worker_processes 2;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
#server 172.16.0.82:8071;
upstream mysvr {
server 172.16.0.201:8086;
}
server {
listen 82;
server_name 172.16.0.137;
location / {
proxy_pass http://mysvr;
proxy_redirect default;
}
}
}
```
0 0
- nginx简单负载均衡设置
- nginx负载均衡设置
- Nginx 负载均衡 设置
- nginx负载均衡设置
- NGINX常用负载均衡设置
- Nginx负载均衡设置实例
- nginx均衡负载的设置
- Nginx负载均衡设置实例
- nginx负载均衡简单配置
- nginx简单实现负载均衡
- nginx负载均衡简单配置
- nginx-负载均衡简单配置
- nginx负载均衡简单配置
- nginx负载均衡简单配置
- nginx负载均衡简单配置
- nginx负载均衡简单配置
- nginx 负载均衡简单实现
- nginx简单负载均衡实现
- FreeBSD的配置经验
- hibernate 10 事务和并发 | hibernate 实战(第二版) 第10章事务和并发 | 笔记
- 美版t430笔记本win8系统下装Ubuntu的一些尝试和遇到的问题
- Android Bootloader LittleKernel的两篇文章
- 如何让 height:100%; 起作用
- nginx简单负载均衡设置
- mysql中limit的用法深入分析
- Codeforces Round #281 (Div. 2) A
- leetcode -- Container With Most Water
- eclipse svn IP 更改
- ZigZag Conversion
- HDU5112
- android平台下使用点九PNG技术
- windows 如何查看端口占用情况?