nginx负载均衡简单实现

1.nginx简单负载

upstream hechaojie.com { 
    server localhost:10000; 
    server 47.91.252.82:10000; 
}
server {
  listen 80;
  server_name localhost hechaojie.com;
  access_log /data/wwwlogs/access_nginx.log combined;
  root /data/wwwroot;
  error_page 502 = /index.html;
  location / {
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header Host $http_host;
        proxy_pass http://hechaojie.com;
  }
}

猜你喜欢

转载自blog.csdn.net/hechaojie_com/article/details/82057227