配置Nginx代理Foursquare

自从Foursquare被墙之后一直用VPN上去checkin,虽说速度还不错,但每次都要先拨通VPN着实麻烦了点。

所以今天装了个支持API版的,试了下Google code上那个PHP版的代理,发现在nginx上要重写rewirte,索性在nginx上直接配个到api.foursquare.com的代理算了。

CONF
server {
    listen          0.0.0.0:80;
    server_name     foursquare.yourdomainname.com;
 
    #access_log      /var/log/nginx/4sq.access_log;
    #error_log       /var/log/nginx/4sq.error_log info;
 
    location / {
        proxy_pass              http://api.foursquare.com/;
        proxy_redirect          off;
        proxy_set_header        X-Real-IP       $remote_addr;
        proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

foursquare.yourdomainname.com根据情况自行设定
此配置仅用作手机端自定义API

Comments (2)

  1. Nerr  / Reply

    呵呵,哥们,这个不是用来在desktop上访问的,我用这个做手机端自定义API
    nginx服务器不能在国内,你应该懂的

  2. punksa  / Reply

    这个配置最终还是会跳转到4sq上吧,然后被墙?

    我的意思是比如我设置了4sq.xxxxx.com,然后在浏览器输入该地址,最终客户端的请求会跳转到api.fousquare.com,这个跳转的时候就被reset了.

    很奇怪的是昨晚配置好后还可以用,今天就被reset鸟…

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" highlight="">

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Pingbacks (0)

› No pingbacks yet.