-
-
Save Mutinux/2882410 to your computer and use it in GitHub Desktop.
nginx 反向代理推特官网移动版给 Chrome Lite/Mobile Safari 使用
This file contains hidden or 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_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