Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/http/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Nginx 本地主机上无重定向的转发代理_Nginx_Proxy_Http Proxy - Fatal编程技术网

Nginx 本地主机上无重定向的转发代理

Nginx 本地主机上无重定向的转发代理,nginx,proxy,http-proxy,Nginx,Proxy,Http Proxy,想知道是否有可能在不离开本地主机的情况下在任何网站中创建代理。例如,我可以使用url中的参数浏览web,如下所示: http://localhost:8080/?q=google.com 将解析http://google.com而不更改浏览器中的url 以下是我到目前为止所做的工作,主要是在没有运气的情况下测试配置: worker_processes 1; events { worker_connections 1024; } http { include mime

想知道是否有可能在不离开本地主机的情况下在任何网站中创建代理。例如,我可以使用url中的参数浏览web,如下所示:

http://localhost:8080/?q=google.com
将解析
http://google.com
而不更改浏览器中的url

以下是我到目前为止所做的工作,主要是在没有运气的情况下测试配置:

worker_processes  1;

events {
  worker_connections  1024;
}

http {
  include       mime.types;
  default_type  application/octet-stream;

  sendfile        on;
  keepalive_timeout  65;

  gzip  on;

  server {
    listen       8880;

    location / {
      resolver 8.8.8.8;
      proxy_pass http://google.com;
      proxy_set_header Host google.com;

      add_header Last-Modified $date_gmt;
      add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
      if_modified_since off;
      expires off;
      etag off;
    }

    error_page   500 502 503 504  /50x.html;
    location = /50x.html {
      root   html;
    }
  }
}
如果您能给我一些反馈或建议,我将非常感激。我可以做些什么来创建这种代理,它可以在不重定向或更改浏览器栏中的url的情况下对内容进行流式处理