Skip to content

Instantly share code, notes, and snippets.

@1a57danc3
Forked from shellexy/fanfou.shellex.info.conf
Last active August 29, 2015 14:10
Show Gist options
  • Save 1a57danc3/50a6408539eb5eae0632 to your computer and use it in GitHub Desktop.
Save 1a57danc3/50a6408539eb5eae0632 to your computer and use it in GitHub Desktop.
# /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_hide_header User-Agent;
#proxy_set_header User-Agent "Mozilla/5.0 (iPhone; U; Linux; zh-cn) AppleWebKit/532+ (KHTML, like Gecko) Version/3.0 Chrome Mobile/1A538b Safari/419.3";
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