nginx 代理详解

编辑配置文件:

vim /usr/local/nginx/conf/vhost/proxy.conf 

加入:

upstream graped
        {
        server 115.239.211.112:80;
        server 115.239.211.112:80;
        }
server {
  listen 80;
  server_name www.baidu.com;

  location /
        {
        proxy_pass   http://graped/;
        proxy_set_header Host   $host;
        proxy_set_header X-Real-IP      $remote_addr;
        }
}