This repository has been archived by the owner on Feb 16, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
appledailyhk.conf
56 lines (52 loc) · 2.16 KB
/
appledailyhk.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
server {
server_name {{HOST}};
listen 80;
return 301 https://{{HOST}}$request_uri;
}
server {
server_name {{HOST}};
listen 443 ssl spdy;
ssl_session_cache shared:SSL:50m;
ssl_session_timeout 5m;
ssl_certificate {{SSL_CRT}};
ssl_certificate_key {{SSL_KEY}};
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers "EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA384 EECDH+ECDSA+SHA256 EECDH+aRSA+SHA384 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EECDH EDH+aRSA RC4 !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS";
subs_filter_types text/html text/css text/javascript application/x-javascript application/json;
subs_filter "(https?:)?(\\\/|/)(\\\/|/)video\.appledaily\.com\.hk" "https:$2$2{{HOST}}$2__appledaily.com.hk$2video" r;
subs_filter "(https?:)?(\\\/|/)(\\\/|/)([^/]+?)\.(nextmedia|facebook|gigya|krxd|serving-sys|amazonaws)\.(com|net)" "https:$2$2{{HOST}}$2__$5.$6$2$4" r;
subs_filter "url\((\"|')?(\.\.)?/web_images/" "url($1/__nextmedia.com/staticlayout.apple/web_images/" r;
subs_filter "url\((\"|')?(\.\.)?/fancybox/" "url($1/__nextmedia.com/staticlayout.apple/fancybox/" r;
subs_filter "function displayFbContent(id){" "function displayFbContent(id){}if(false){";
subs_filter "FB.init({" "false&&FB.init({";
subs_filter "https://{{HOST}}/__nextmedia.com/hk.apple" "https://{{HOST}}";
location = /__facebook.net/connect/zh_TW/all.js {
default_type text/javascript;
return 200;
}
location = /__nextmedia.com/staticlayout.apple/rtncommon/info.json {
resolver 8.8.8.8;
proxy_pass http://staticlayout.apple.nextmedia.com;
proxy_set_header Accept-Encoding "";
proxy_hide_header Content-Type;
add_header Content-Type text/javascript;
rewrite ^ /rtncommon/info.json break;
}
location ~ /__nextmedia.com/hk\.apple/?$ {
return 302 https://{{HOST}};
}
location ~ /__nextmedia.com/([^/]+?)/?$ {
return 302 http://$1.nextmedia.com;
}
location ~ /__([^.]+?)\.([^/]+?)/([^/]+?)/(.*) {
resolver 8.8.8.8;
proxy_pass http://$3.$1.$2;
proxy_set_header Accept-Encoding "";
rewrite /__([^.]+?)\.([^/]+?)/([^/]+?)/(.*) /$4 break;
}
location / {
proxy_pass http://hk.apple.nextmedia.com;
proxy_set_header Accept-Encoding "";
}
}