-
-
Save 1a57danc3/50a6408539eb5eae0632 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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