upstream hbwx_read {
#ip_hash;
server 192.168.7.53:18080 weight=2 max_fails=5 fail_timeout=2;
}
upstream hbwx_write {
#ip_hash;
server 192.168.6.203:11000 weight=2 max_fails=10 fail_timeout=2;
#server 127.0.0.1:8080 backup;
}
server {
listen 80;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
root html;
index index.html index.htm;
}
location ~ ^/1[0-9][0-9]/ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://hbwx_read;
}
location ~ ^/hbwx/wsdc/(addOrderCart|paySaleOrder|addSaleOrder).do$ {
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://hbwx_write;
}
location ~ ^/hbwx/ {
#echo "match hbwexin first";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://hbwx_read;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
nginx读写分离
原创
©著作权归作者所有:来自51CTO博客作者kq1983的原创作品,请联系作者获取转载授权,否则将追究法律责任
读写分离
上一篇:proxy_cache
下一篇:windows10 输入法繁体
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
ProxySQL--读写分离(3)
ProxySQL--读写分离
MySQL proxysql -
nginx的读写分离
nginx的读写分离、$request_method模块
request nginx 读写分离 -
nginx实现读写分离
一个简易实现nginx读写分离的例子
nginx实现读写分离