server {
    #开放端口
    listen 80;

    #站点域名
    server_name a.com;

    #站点根路径
    root /data/www/a;

    #访问日志
    access_log      /data/logs/a.log;

    #对php ci框架控制器支持
    location / {
        proxy_ignore_client_abort on;
        proxy_read_timeout 200s;
        proxy_redirect    off;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header Host $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto  $scheme;
        client_max_body_size    1000m;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        
        # 负载均衡
        proxy_pass http://a.com;
    }

    # 反向代理
    location /marvin/ {
        proxy_pass http://192.168.0.254:18080/;
    }

    # 反向代理
    location /mrs/ {
        proxy_pass http://192.168.0.254:8080/;
    }
}

# 负载均衡
upstream a.com {
    #ip_hash;
    server  192.168.0.253:81 weight=1;
    server  192.168.0.253:82 weight=1;
    server  192.168.0.254:81 weight=1;
    server  192.168.0.254:82 weight=1;
}
