负载均衡nginx反向代理
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了负载均衡nginx反向代理相关的知识,希望对你有一定的参考价值。
#######nginx 配置文件
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
upstream web_pools {
server 10.0.0.7:80 weight=1 max_fails=1 fail_timeout=10s ;
server 10.0.0.8:80 weight=1 max_fails=1 fail_timeout=10s ;
}
server {
listen 80;
server_name www.etiantian.org;
location / {
proxy_pass http://web_pools;
proxy_set_header Host $host;
}
}
server {
listen 80;
server_name bbs.etiantian.org;
location / {
proxy_pass http://web_pools;
proxy_set_header Host $host;
}
}
server {
listen 80;
server_name blog.etiantian.org;
location / {
proxy_pass http://web_pools;
proxy_set_header Host $host;
}
}
以上是关于负载均衡nginx反向代理的主要内容,如果未能解决你的问题,请参考以下文章
nginx反向代理访问很慢,我做了负载均衡,现在几乎无法访问,有谁能帮我解决一下,万分感谢。