美文网首页
Nginx反向代理谷歌

Nginx反向代理谷歌

作者: 南风nanfeng | 来源:发表于2019-05-15 09:54 被阅读0次

第一、首先具备一台访问谷歌的外网服务器。
第二、安装Nginx。采用最便捷的yum安装,或者可以下载rpm包、源码安装。
第三、配置谷歌的反向代理,启动Nginx服务。
第四、客户端配置host。
第五、访问Google。

> yum install -y nginx
> whereis nginx
nginx: /usr/sbin/nginx /usr/lib64/nginx /etc/nginx /usr/share/nginx

> vim /etc/nginx/conf.d/google.conf
server {
        listen  80;
        server_name     igoogle.com;
        resolver        8.8.8.8;
        location / {
                root html;
                index index.html index.htm;
                proxy_pass https://www.google.com;
                proxy_connect_timeout 120;
                proxy_read_timeout 600;
                proxy_send_timeout 600;
                send_timeout 600;
                proxy_redirect    off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }

}

> /usr/sbin/nginx

相关文章

网友评论

      本文标题:Nginx反向代理谷歌

      本文链接:https://www.haomeiwen.com/subject/nmuuaqtx.html