Node.js+Socket.io訊息中心實施之十 nginx負載均衡部署
#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 {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
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 bakend
{
ip_hash;
server 10.1.58.191:8080;
server 10.0.57.143:8080;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
proxy_pass ;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
#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 ;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
#location ~ \.php$ {
# root html;
# fastcgi_pass 127.0.0.1:9000;
# fastcgi_index index.php;
# fastcgi_param SCRIPT_FILENAME /scripts$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 ssl;
# server_name localhost;
# ssl_certificate cert.pem;
# ssl_certificate_key cert.key;
# ssl_session_cache shared:SSL:1m;
# ssl_session_timeout 5m;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# location / {
# root html;
# index index.html index.htm;
# }
#}
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28624388/viewspace-1218503/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Node.js+Socket.io訊息中心實施之七 訊息中心的實現(5)Node.js
- Node.js+Socket.io訊息中心實施之六 訊息中心的實現(4)Node.js
- Node.js+Socket.io訊息中心實施之四 訊息中心的實現(2)Node.js
- Node.js+Socket.io訊息中心實施之三 訊息中心的實現(1)Node.js
- Node.js+Socket.io訊息中心實施之一 背景Node.js
- 【Nginx】Nginx反向代理和負載均衡部署Nginx負載
- Nginx+Tomcat部署負載均衡NginxTomcat負載
- nginx實現負載均衡Nginx負載
- nginx學習之負載均衡Nginx負載
- [Open Source] 負載均衡之Nginx負載Nginx
- NGINX 負載均衡Nginx負載
- 【Nginx】負載均衡Nginx負載
- nginx負載均衡Nginx負載
- Nginx + IIS 實現負載均衡Nginx負載
- Node.js+Socket.io訊息中心實施之二 架構與主要功能Node.js架構
- Nginx負載均衡之健康檢查Nginx負載
- nginx部署基於http負載均衡器NginxHTTP負載
- Nginx反向代理負載均衡的容器化部署Nginx負載
- 自動化部署nginx負載均衡及監控簡訊報警Nginx負載
- Nginx負載均衡模式Nginx負載模式
- Nginx--負載均衡Nginx負載
- nginx 負載均衡搭建Nginx負載
- Nginx負載均衡策略Nginx負載
- 解析 Nginx 負載均衡Nginx負載
- nginx Win下實現簡單的負載均衡(1)nginx搭建部署Nginx負載
- 負載均衡之--Nginx、LVS、HAProxy負載Nginx
- Django筆記四十四之Nginx+uWSGI部署Django以及Nginx負載均衡操作Django筆記Nginx負載
- 簡單實踐搭建 nginx 負載均衡Nginx負載
- Nginx如何實現四層負載均衡?Nginx負載
- nginx+tomcat實現負載均衡NginxTomcat負載
- Nginx實現簡單的負載均衡Nginx負載
- Nginx負載均衡詳解Nginx負載
- Nginx負載均衡高可用Nginx負載
- docker初體驗:docker部署nginx負載均衡叢集DockerNginx負載
- 【nginx】用Redware、Nginx、Keepalive實現的負載均衡Nginx負載
- Keepalived實現Nginx負載均衡高可用Nginx負載
- nginx實現兩臺服務負載均衡Nginx負載
- Docker Compose+nginx實現負載均衡DockerNginx負載