server
{
listen 8000;
location / {
proxy_pass http://$http_host$request_uri;
}
}

http 里加上 resolver 8.8.8.8

如上配置

在浏览器里设置代理 ip访问可成功代理出去 域名访问则不可以