nginx负载均衡配置
配置文件
以下代码仅作示例,仅仅是把动态页面均衡到各个server上。
upstream myServer {
server 127.0.0.1:81;
server 127.0.0.2:81 down;
server 127.0.0.3:81 weight=1;
server 127.0.0.4:81 backup;
}
server {
listen 127.0.0.1:80;
server_name type.so www.type.so;
access_log /var/log/httpd/domains/type.so.log combined;
location / {
try_files $uri @backend;
}
location ~* \.(jpeg|jpg|gif|png|bmp|ico|js|css|swf)$ {
root /var/www/html/type.so;
expires 7d;
try_files $uri @backend;
}
location ~ .*\.(htaccess|htpasswd|mdb)?$ {
deny all;
}
location @backend {
internal;
proxy_pass http://myServer;
include proxy.inc;
}
}
请教下,配置中的@backend是什么意思呀? 是变了吗?
指的是下面的location