-
Notifications
You must be signed in to change notification settings - Fork 18
/
nginx.conf
87 lines (74 loc) · 3.4 KB
/
nginx.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
server {
server_name up.wiki.yourdomain.com;
listen 80;
location / {
proxy_pass https://upload.wikimedia.org;
proxy_cookie_domain upload.wikimedia.org up.wiki.yourdomain.com;
proxy_buffering off;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header referer "https://upload.wikimedia.org$request_uri";
}
}
server {
server_name wiki.yourdomain.com;
listen 80;
resolver 8.8.8.8;
location / {
proxy_pass https://www.wikipedia.org;
proxy_buffering off;
proxy_redirect https://www.wikipedia.org/ http://wiki.yourdomain.com/;
proxy_cookie_domain www.wikipedia.org wiki.yourdomain.com;
proxy_redirect ~^https://([\w\.]+).wikipedia.org/(.*?)$ http://$1.wiki.sxisa.org/$2;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Encoding '';
proxy_set_header referer "https://$proxy_host$request_uri";
subs_filter_types text/css text/xml text/javascript application/javascript application/json;
subs_filter .wikipedia.org .wiki.yourdomain.com;
subs_filter //wikipedia.org //wiki.yourdomain.com;
subs_filter upload.wikimedia.org up.wiki.yourdomain.com;
}
}
server {
server_name ~^(?<subdomain>[^.]+)\.wiki\.yourdomain\.com$;
listen 80;
resolver 8.8.8.8;
location / {
proxy_pass https://$subdomain.wikipedia.org;
proxy_buffering off;
proxy_redirect https://$subdomain.wikipedia.org/ http://$subdomain.wiki.yourdomain.com/;
proxy_redirect https://$subdomain.m.wikipedia.org/ http://$subdomain.m.wiki.yourdomain.com/;
proxy_cookie_domain $subdomain.wikipedia.org $subdomain.wiki.yourdomain.com;
proxy_redirect ~^https://([\w\.]+).wikipedia.org/(.*?)$ http://$1.wiki.sxisa.org/$2;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Encoding '';
proxy_set_header referer "https://$proxy_host$request_uri";
subs_filter_types text/css text/xml text/javascript application/javascript application/json;
subs_filter .wikipedia.org .wiki.yourdomain.com;
subs_filter //wikipedia.org //wiki.yourdomain.com;
subs_filter 'https://([^.]+).wiki' 'http://$1.wiki' igr;
subs_filter upload.wikimedia.org up.wiki.yourdomain.com;
}
}
server {
server_name ~^(?<subdomain>[^.]+)\.m\.wiki\.yourdomain\.com$;
listen 80;
resolver 8.8.8.8;
location / {
proxy_pass https://$subdomain.m.wikipedia.org;
proxy_buffering off;
proxy_redirect https://$subdomain.m.wikipedia.org/ http://$subdomain.m.wiki.yourdomain.com/;
proxy_cookie_domain $subdomain.m.wikipedia.org $subdomain.m.wiki.yourdomain.com;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Encoding '';
proxy_set_header referer "https://$proxy_host$request_uri";
subs_filter_types text/css text/xml text/javascript application/javascript application/json;
subs_filter .wikipedia.org .wiki.yourdomain.com;
subs_filter //wikipedia.org //wiki.yourdomain.com;
subs_filter 'https://([^.]+).m.wiki' 'http://$1.m.wiki' igr;
subs_filter upload.wikimedia.org up.wiki.yourdomain.com;
}
}