Nginx Load Balancing
来源:互联网 发布:刷机会不会丢失数据 编辑:程序博客网 时间:2024/05/30 04:30
Nginx 简单的负载均衡配置示例:
/etc/nginx/nginx.conf
:
http { ... upstream myproject { server 127.0.0.1:8000 weight=3; server 127.0.0.1:8001; server 127.0.0.1:8002; server 127.0.0.1:8003; } server { listen 80; server_name www.domain.com; location / { proxy_pass http://myproject; } } ## # Logging Settings ## log_format access '$remote_addr - $remote_user [$time_local] ' '"$request" $status $body_bytes_sent ' ' $request_time $upstream_response_time'; access_log /var/log/nginx/access.log access; error_log /var/log/nginx/error.log; ...}
/etc/hosts
:
127.0.0.1 localhost127.0.1.1 user-3010# myproject127.0.0.1 www.domain.com
或
/etc/nginx/nginx.conf
:
http { ... upstream myproject { server 127.0.0.1:8000 weight=3; server 127.0.0.1:8001; server 127.0.0.1:8002; server 127.0.0.1:8003; } server { listen 80; server_name self_machine_ip_address; location / { proxy_pass http://myproject; } ...}
/var/log/nginx/access.log
:
192.168.222.9 - - [11/Jan/2016:16:09:47 +0800] "GET /myproject/users HTTP/1.1" 200 12964 0.010 0.001, 0.009
参考链接: Simple Load Balancing & Logging Settings
0 0
- Nginx Load Balancing
- Nginx Load Balancing — Advanced Configuration
- 实践NGINX Load Balancing – HTTP Load Balancer
- Load Balancing
- load balancing
- Load Balancing
- Load Balancing
- Load Balancing Web Applications
- Server Load Balancing
- Apache + Tomcat + Load Balancing
- Load balancing (computing)
- Hbase Load Balancing
- hdu 2850 Load Balancing
- Runtime Connection Load Balancing
- Load Balancing Web Applications
- HDU 2850 Load Balancing
- ICPC 6924 Load Balancing
- Codeforce----Load Balancing
- 解决Plugin is too old,please update to a more recent version,or set ANDROID_DAILY_OVERRIDE..
- jvm钩子:Java应用中使用ShutdownHook友好地清理现场
- Android 之WebView+ProgressBar 完美结合
- Javascript单元测试框架Qunit和Jasmine的比较
- /var/run/yum.pid 已被锁定 解决办法
- Nginx Load Balancing
- 模拟退火解决TSP问题
- 通过java反射机制获取该类的所有属性类型、值。
- android APN解析
- 安装 Ubuntu 14.04 之后要做的一些事
- css3时钟
- 目标检测的图像特征提取之Haar特征
- spring自动扫描的问题
- 安装Android studio出现'tools.jar' seems to be not in Android Studio classpath的解决方法