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

问题描述

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

http://localhost:8080/?q=google.com

将解析http://google.com,而无需在浏览器中更改网址。

这是我到目前为止的内容,主要是测试运气不佳的配置:

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来传输内容的代理,我将非常感激。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)