6

我使用 nginx x 作为反向代理。这是我的配置:

location /google/ {
    rewrite            ^/google/(.*) /$1 break;

    proxy_set_header   Host                 $host;
    proxy_set_header   X-Forwarded-For      $proxy_add_x_forwarded_for;     
    proxy_set_header   X-Real-IP            $remote_addr;

    proxy_pass         http://www.google.com;
}

问题是我所有的出站HTTP请求都通过我的公司代理,而nginx给了我这个错误(似乎域名解析是通过代理进行的)

nginx: [emerg] host not found in upstream "backend" in nginx.conf:xxx

如何配置 nginx 以使用此代理进行传出请求?

4

0 回答 0