Skip to content

Instantly share code, notes, and snippets.

@Mutinux
Forked from shellexy/fanfou.shellex.info.conf
Created June 6, 2012 15:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mutinux/2882410 to your computer and use it in GitHub Desktop.
Save Mutinux/2882410 to your computer and use it in GitHub Desktop.
nginx 反向代理推特官网移动版给 Chrome Lite/Mobile Safari 使用
# /etc/nginx/sites-available/fanfou.shellex.info
# 这儿假设的域名是 fanfou.shellex.info
# 请替换为实际的域名
server {
resolver 8.8.8.8;
listen 443;
server_name fanfou.shellex.info;
ssl on;
#ssl_certificate /etc/nginx/ssl/server.crt;
#ssl_certificate_key /etc/nginx/ssl/server.key;
if ($http_user_agent !~ "Chrome|Safari|Opera") { return 404; }
access_log /var/log/nginx/fanfou.access.log;
location / {
gzip on;
proxy_set_header Accept-Encoding "";
proxy_redirect https://mobile.twitter.com/ https://fanfou.shellex.info/;
proxy_pass https://mobile.twitter.com$request_uri;
sub_filter mobile.twitter.com fanfou.shellex.info;
sub_filter_once off;
}
}
server {
listen 80;
server_name fanfou.shellex.info;
if ($http_user_agent !~ "Chrome|Safari|Opera") { return 404; }
rewrite ^/(.*) https://$host$request_uri permanent;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment