yava555
V2EX  ›  Twitter

nginx 搭建的 twitter api 无法使用了

  •  
  •   yava555 · Sep 5, 2010 · 7626 views
    This topic created in 5765 days ago, the information mentioned may be changed or developed.
    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 replies    1970-01-01 08:00:00 +08:00
    yava555
        1
    yava555  
    OP
       Sep 5, 2010 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  
       Sep 5, 2010
    同问,我也遇到了这个问题
    Livid
        3
    Livid  
    MOD
    PRO
       Sep 5, 2010
    Twitter 的 API 服务器的地址是:

    api.twitter.com

    改成这个试试?
    zhangxqn78
        4
    zhangxqn78  
       Sep 7, 2010
    求搭建oauth API的教程,不想要GAE搭建的,太耗流量了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4298 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 59ms · UTC 05:34 · PVG 13:34 · LAX 22:34 · JFK 01:34
    ♥ Do have faith in what you're doing.