💗心爱的💗-小沨

  • 首页
  • 网盘
  • 图床
  • 赞助
  • 关于本站
私人小天地
谈天说地,学习笔记
  1. 首页
  2. Linux系统
  3. 正文

ghs.google.com域名反向代理

2010年5月4日 4282点热度 0人点赞 0条评论

Google的App服务可以用自定义地址来访问,只需要在Google App设置里设置为自定义的域名,然后设置域名的CNAME到ghs.google.com。但这个ghs.google.com在国内被屏蔽了,直接按google默认要求的做是无法使用自定义域名访问App服务的,解决的方法是nginx的反向代理服务。前提是已经安装好nginx,在/user/local/nginx/conf/nginx.conf中,添加一段类似server{…}的代码。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
upstream ghs {
   ip_hash;
   server ghs.google.com;
   server 72.14.203.121;
   server 72.14.207.121;
   server 74.125.43.121;
   server 74.125.47.121;
   server 74.125.53.121;
   server 74.125.77.121;
   server 74.125.93.121;
   server 74.125.95.121;
   server 74.125.113.121;
   server 216.239.32.21;
   server 216.239.34.21;
   server 216.239.36.21;
   server 216.239.38.21;
 }

server {
listen 80;
server_name  ghs.domain.com;
location /  {
     proxy_set_header Host $host;
     proxy_pass http://ghs;
     proxy_set_header  X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

然后重启:

1
2
3
killall nginx

/usr/local/nginx/sbin/nginx
第2个方案:
upstream ghs {
   ip_hash;
   server ghs.google.com;
   server 72.14.203.121;
   server 72.14.207.121;
   server 74.125.43.121;
   server 74.125.47.121;
   server 74.125.53.121;
   server 74.125.77.121;
   server 74.125.93.121;
   server 74.125.95.121;
   server 74.125.113.121;
   server 216.239.32.21;
   server 216.239.34.21;
   server 216.239.36.21;
   server 216.239.38.21;
}

server {
   listen       你vpsIP:80;
   server_name  ghs.dmain.com;
#下行中的ghs换成自己定义的名称。
    log_format  ghs  '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" $http_x_forwarded_for';
#下行中两处ghs换成自己定义的名称。
   access_log  /home/log/ghs.log ghs;

   location / {
     proxy_redirect off;
     proxy_set_header Host $host;
     proxy_pass http://ghs;
     proxy_set_header  X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_redirect false;
   }

}

server {
   listen       你vpsIP:443;
   server_name  ghs.dmain.com;
   log_format  mail  '$remote_addr - $remote_user [$time_local] "$request" '
               '$status $body_bytes_sent "$http_referer" '
               '"$http_user_agent" $http_x_forwarded_for';
   access_log  /home/log/mail.log mail;

   location / {
     proxy_redirect off;
     proxy_set_header Host $host;
     proxy_pass http://ghs;
     proxy_set_header  X-Real-IP  $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_redirect false;
   }
}
标签: ghs.google.com,域名,反向,代理
最后更新:2010年5月4日

mikj

这个人很懒,什么都没留下

打赏 点赞
< 上一篇
下一篇 >

文章评论

您需要 登录 之后才可以评论
站内搜索
联系我
分类
  • AI智能
  • Android
  • Linux系统
  • VPS服务器
  • windows系统
  • wordpress
  • 域名相关
  • 建站分享
  • 教程学习
  • 数据库类
  • 旅行点滴
  • 未分类
  • 网络服务
  • 资源分享
  • 跨境出海
  • 金融投资
友情链接
  • QQPCC
  • vzone
  • 娃娃博客
  • 傻子-跸西的blog
  • 撸羊毛
  • 死老鬼
  • 夜狐
  • 我的图库
  • 爱购啦
  • 怪鸟博客
  • 豆博
  • 陈否否
  • semnew
  • 轨迹博客
  • QQTM论坛
  • 光的魔术师
  • 天下无鱼
  • 李子博客
  • 寥寥后花园
  • 朱志瑞
  • Shucheng Li
  • 我喔喔喔
  • 麦麦同学
  • 小沨记事本
  • LINUX DO

COPYRIGHT © 2025 Xinai.De. ALL RIGHTS RESERVED.@ 网站运行:@ 服务器运行状态

Theme Kratos Made By Seaton Jiang