#user nobody;
worker_processes 1;
#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;
#负载平衡从这开始
upstream localhost {
server 127.0.0.1:81;
server 127.0.0.1:82;
}
server {
listen 80;
server_name www.aqqla.com;
charset gbk;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm index.php;
# 负载指向
proxy_pass http://localhost;
proxy_set_header X-Real-IP $remote_addr;
client_max_body_size 100m;
proxy_redirect default;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
# 这里是php支持配置 可以注释掉
location ~ \.php$ {
# root html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME d:\www\html$fastcgi_script_name;
include fastcgi_params;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
# another virtual host using mix of IP-, name-, and port-based configuration
#
#server {
# listen 8000;
# listen somename:8080;
# server_name somename alias another.alias;
# location / {
# root html;
# index index.html index.htm;
# }
#}
# HTTPS server
#
#server {
# listen 443;
# server_name localhost;
# ssl on;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_timeout 5m;
# ssl_protocols SSLv2 SSLv3 TLSv1;
# ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
nginx开80 做负载器
apache开81 82 做支点
分享到:
相关推荐
基于nginx负载均衡的集群聊天系统,其中技术点有网络方面、数据库方面、线程安全方面;功能点有添加好友、单人聊天、群组聊天等 基于nginx负载均衡的集群聊天系统,其中技术点有网络方面、数据库方面、线程安全方面...
基于nginx tcp负载均衡 + redis的集群聊天服务器,网络层使用muduo库搭建,数据库使用MySQL 基于nginx tcp负载均衡 + redis的集群聊天服务器,网络层使用muduo库搭建,数据库使用MySQL 基于nginx tcp负载均衡 + ...
java基于nginx的tomcat负载均衡和集群
基于重写的muduo网络库,并可工作于nginx tcp负载均衡环境的集群聊天服务器,使用数据库连接池访问数据库 基于重写的muduo网络库,并可工作于nginx tcp负载均衡环境的集群聊天服务器,使用数据库连接池访问数据库 ...
随着过去几十年互联网服务的指数增长,各大网站的访问量急剧上升。海量的用户请求使得热门网站的网络请求率可能在几秒钟内大...通过实验测试,对比不同算法下的负载均衡性能,改进后的算法能有效提高服务器集群的性能。
在一台服务器的操作系统上,安装一个附加软件来实现负载均衡,如Nginx负载均衡(我们管理系统平台使用的也是这款均衡器)。它的优点是基于特定环境、配置简单、使用灵活、成本低廉,可以满足大部分
NULL 博文链接:https://jin8000608172.iteye.com/blog/2170407
基于muduo网络库的集群聊天服务器和客户端源码,使用nginx tcp负载均衡,mysql 基于muduo网络库的集群聊天服务器和客户端源码,使用nginx tcp负载均衡,mysql数据库,redis发布-订阅数据库,redis发布-订阅 基于...
nginx+redis负载均衡、session共享,基于redis+tomcat实现session同步的简单demo
可以工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端源码 基于muduo库实现 redis用于服务器中间件即消息队列 mysql用于保存用户数据 可以工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端源码 基于...
Maven Spring(IOC DI AOP 声明式事务处理) SpringMVC(支持Restful风格) ...Nginx静态加载、负载均衡 基于keepalived的nginx高可用方案 Tomcat集群(Redis共享Session) Sping Shiro权限控制(待完善)
基于muduo库实现了工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端,采用redis消息队列进行集群,mysql数据库存储 基于muduo库实现了工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端,采用redis消息...
可以工作在 nginx tcp 负载均衡环境中的集群聊天服务器和客户端源码 基于 muduo,nginx,redis 实现 添加了数据库连接池提高了并发能力,并且降低了聊天延迟 可以工作在 nginx tcp 负载均衡环境中的集群聊天服务器和...
nginx+tomcat+memcached集群和负载均衡所有资源包,具体集群方法请参见博文:http://blog.csdn.net/l1028386804/article/details/48289765
基于muduo库开发的集群聊天服务器和客户端源码,可以工作在nginx tcp负载均衡环境中,使用mysql数据库,运用了json的序列化和反序列化 基于muduo库开发的集群聊天服务器和客户端源码,可以工作在nginx tcp负载均衡...
可以工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端源码 基于nuduo库实现 使用了redis发布订阅消息队列 数据库采用MySQL 可以工作在nginx tcp负载均衡环境中的集群聊天服务器和客户端源码 基于nuduo库实现 ...
基于muduo库实现的集群聊天服务器,通过mysql存储数据,通过nginx实现tcp负载均衡,通过redis实现集群内服务器间的消息订阅发布。 基于muduo库实现的集群聊天服务器,通过mysql存储数据,通过nginx实现tcp负载均衡,...
采用nginx实现负载均衡,结合redis发布-订阅模式来实现在不同服务器上客户端进行通信。 基于moduo实现的集群聊天服务器和客户端源码,使用mysql数据库存储相关数据。采用nginx实现负载均衡,结合redis发布-订阅模式...
集群聊天服务器(nginx tcp负载均衡模块、muduo网络库、基于发布-订阅的redis消息队列、mysql数据库) 集群聊天服务器(nginx tcp负载均衡模块、muduo网络库、基于发布-订阅的redis消息队列、mysql数据库) 集群聊天...
随着你的网站业务量的增长你网站的服务器压力越来越大?需要负载均衡方案!商业的硬件如F5又太贵,你们又是创业型互联公司...我们利用LVS+Keepalived基于完整开源软件的架构可以为你提供一个负载均衡及高可用的服务器。