V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
yava555
V2EX  ›  Twitter

nginx 搭建的 twitter api 无法使用了

  •  
  •   yava555 · 2010-09-05 10:10:19 +08:00 · 6562 次点击
    这是一个创建于 4984 天前的主题,其中的信息可能已经有所发展或是发生改变。
    server {
    listen 80;
    server_name xx.xxx.com;
    location / {
    proxy_pass http://twitter.com/;
    proxy_redirect off;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }

    之前一直通过nginx反向代理方式搭建twitter api,最近发现无法使用了。

    通过浏览器能访问首页,但是在adnroid手机上使用seesmic客户端就会出问题了。

    大家知道是什么原因导致的吗?
    4 条回复    1970-01-01 08:00:00 +08:00
    yava555
        1
    yava555  
    OP
       2010-09-05 10:18:03 +08:00 via iPhone
    twitter会检测http请求头中的User-Agent,如果是来自手机则会跳转到 http://mobile.twitter.com

    一开始是以为这个原因导致的

    但是在nginx中进行了伪装User-Agent也不管用:

    proxy_set_header User-Agent Mozilla/5.0 (Windows; U; MSIE 9.0; Windows NT 9.0; en-US)
    summic
        2
    summic  
       2010-09-05 16:00:49 +08:00
    同问,我也遇到了这个问题
    Livid
        3
    Livid  
    MOD
       2010-09-05 16:13:40 +08:00
    Twitter 的 API 服务器的地址是:

    api.twitter.com

    改成这个试试?
    zhangxqn78
        4
    zhangxqn78  
       2010-09-07 12:53:20 +08:00
    求搭建oauth API的教程,不想要GAE搭建的,太耗流量了
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4097 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 24ms · UTC 05:22 · PVG 13:22 · LAX 22:22 · JFK 01:22
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.