How to configure Google reverse proxy on Nginx server
一、直接反向代理,使用的是7ghost源码搭建,优点是简单容易上手,缺点是容易被屏蔽,不能搜索敏感词。
二、使用ssl加密反向代理,优点是安全、不易被屏蔽,缺点是技术性相对较强,需要折腾的地方也多。
现在主要简单说下第二种方法的设置过程。
step1:你得需要有一台linux的海外vps。
step2:nginx环境的建立(为了方便,教程中就用amh一键包进行环境构建,当然你用军哥一键包或纯nginx环境#也就是只安装nginx,不用安装php、sql啥的#都是可以的。)
step3:安装好amh后,登陆amh后台(默认地址为你的vps ip地址:8888),点击模块扩展——下载模块——搜索“ssl”,点击下载。
好了,现在咱们的ssl模块已经安装完成了。
现在点击虚拟主机,填写好域名信息,点击ssl配置,配置ssl相关信息。
接着在vps中执行vim /usr/local/nginx/conf/vhost/你的域名.conf (其他环境的以你的环境为准,amh的conf在此处)
新增代码(要先把你的域名.conf这个文件全部清空再复制粘贴如下代码),然后保存退出,重启nginx即可。(代码根据实际情况需要做一些改动,这里以完整代码的形式给出,代码最后一部分是让访问http跳转到https)
server { listen 443; server_name guance.com; ssl on; ssl_certificate /usr/local/nginx/conf/ssl/www.guance.com.crt; ssl_certificate_key /usr/local/nginx/conf/ssl/www.guance.com.pem; ssl_protocols sslv3 tlsv1; ssl_ciphers all:-adh:+high:+medium:-low:-sslv2:-exp; location / { proxy_redirect off; proxy_pass https://www.google.co.jp/; proxy_redirect http://www.google.com/ /; proxy_cookie_domain google.com guance.com; proxy_set_header accept-encoding ""; proxy_set_header user-agent $http_user_agent; proxy_set_header accept-language "zh-cn"; proxy_set_header cookie "pref=id=047808f19f6de346:u=0f62f33dd8549d11:ff=2:ld=zh-cn:nw=1:tm=1325338577:lm=1332142444:gm=1:sg=2:s=re0syjh2w1iq-maw"; } } server { listen 80; server_name guance.com; rewrite ^(.*) https://guance.com$1 permanent; } server { listen 80; server_name www.guance.com; rewrite ^(.*) https://guance.com$1 permanent; } server { listen www.guance.com:80; server_name guance.com; rewrite ^(.*)$ https://$host$1 permanent; }
到这里已经全部完成。
ps:关于ssl加密
ssl全称是security socket layer,如果网站使用了ssl加密,gfш就无法封域名了,因为传输过程中url也是加密的,gfш无能为力。但是gfш是可以封ip的443端口的,不过那样的话也还是可以通过更换ip来达到避免被墙的目的。
gfш封锁google的ssl加密搜索,原理就是屏蔽google指定ip的443端口。因为建立https连接的第一步是请求google发证书过来:发一个http数据包到google的ip地址,里面写着443端口,gfш一看,封!
443端口即网页浏览端口,主要是用于https服务,是提供加密和通过安全端口传输的另一种http。在一些对安全性要求较高的网站,比如银行、证券、购物等,都采用https服务,这样在这些网站上的交换信息其他人都无法看到,保证了交易的安全性。网页的地址以https://开始,而不是常见的http://。
ssl证书需要购买,网上有很多便宜的ssl证书,大概10美元一年,这和一个.com域名的年费差不多。而且事实上,还能找到免费的ssl证书,例如startssl.com提供的免费证书。在效力上,便宜的证书当然会比大机构颁发的证书差一点,但是几乎所有的主流浏览器都接受这些证书。
网站使用ssl加密对搜索引擎不太友好,百度基本不收录https网站(一些大站除外),但是对谷歌是没有影响的。
The above is the detailed content of How to configure Google reverse proxy on Nginx server. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Google has introduced DisplayPort Alternate Mode with the Pixel 8 series, and it's present on the newly launched Pixel 9 lineup. While it's mainly there to let you mirror the smartphone display with a connected screen, you can also use it for desktop

Google recently responded to the performance concerns about the Tensor G4 of the Pixel 9 line. The company said that the SoC wasn't designed to beat benchmarks. Instead, the team focused on making it perform well in the areas where Google wants the c

Google's AI Test Kitchen, which includes a suite of AI design tools for users to play with, has now opened up to users in well over 100 countries worldwide. This move marks the first time that many around the world will be able to use Imagen 3, Googl

Google's new Pixel 9 series has introduced a new variant that wasn't present in previous lineups, the Pixel 9 Pro XL. It is essentially identical to the non-XL variant (pre-order at Amazon), but as the name suggests, it has a larger screen. The two e

The Pixel 9 Pro Fold is akin to a volte-face for Google's nascent foldable division. In fact, such are the differences between thePixel 9 Pro Foldand the Pixel Fold that the former has been compared more against the OnePlus Open (curr. $1,399.99 on A

The Google Pixel 9 Pro and Pro XL are Google's answers to the likes of the Samsung Galaxy S24 Ultra and the Apple iPhone 15 Pro and Pro Max. Daniel Sin on YouTube(watch below) has compared the Google Pixel 9 Pro XL to the iPhone 15 Pro Max with some

Hardly any time has passed since Google announced its first Pixel 9 series smartphones. In fact, it has only just started shipping the Pixel 9, Pixel 9 Pro and Pixel 9 Pro XL (curr. $1,099 on Amazon). By contrast, Pixel 9 Pro Fold pre-orders will not

From the get-go, the Google Pixel series was never about beating the top-performing competitors in performance benchmarks. The case for the Google Pixel 9 lineup isn't much different, as the early benchmark results show that the Tensor G4 is quite be
