wildcard support for wikipedia & steam community

This commit is contained in:
Mashiro 2019-06-27 21:20:47 +08:00
parent 5e90308657
commit 840ea9b4bd
4 changed files with 78 additions and 24 deletions

View File

@ -248,24 +248,62 @@ http {
} }
} }
upstream wikipedia-server {
server 198.35.26.96:443;
server 103.102.166.224:443;
}
server { server {
listen 443 ssl; listen 443 ssl;
server_name zh.wikipedia.org; server_name *.wikipedia.org;
server_name zh-yue.wikipedia.org; server_name *.m.wikipedia.org;
server_name wuu.wikipedia.org;
server_name ug.wikipedia.org;
server_name ja.wikipedia.org;
server_name zh.wikinews.org;
server_name zh.m.wikipedia.org;
server_name ug.m.wikipedia.org;
server_name zh.m.wikinews.org;
ssl on; ssl on;
ssl_certificate ca/pixiv.net.crt; ssl_certificate ca/pixiv.net.crt;
ssl_certificate_key ca/pixiv.net.key; ssl_certificate_key ca/pixiv.net.key;
location / { location / {
proxy_pass https://103.102.166.224/; proxy_pass https://wikipedia-server/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Encoding '';
proxy_buffering off;
}
}
server {
listen 443 ssl;
server_name *.steamcommunity.com;
server_name steamcommunity.com;
ssl on;
ssl_certificate ca/pixiv.net.crt;
ssl_certificate_key ca/pixiv.net.key;
location / {
proxy_pass https://104.111.160.41/;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real_IP $remote_addr;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Encoding '';
proxy_buffering off;
}
}
server {
listen 443 ssl;
server_name *.steampowered.com;
server_name steampowered.com;
ssl on;
ssl_certificate ca/pixiv.net.crt;
ssl_certificate_key ca/pixiv.net.key;
location / {
proxy_pass https://23.77.18.43/;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Real_IP $remote_addr;

13
hosts
View File

@ -1,4 +1,4 @@
#本地化的登陆/注册界面的人机验证插件 #www.google.com域名仅用于登陆验证
#如果你不需要这个功能,请把下一行删掉 #如果你不需要这个功能,请把下一行删掉
127.0.0.1 www.google.com 127.0.0.1 www.google.com
@ -34,10 +34,19 @@
# 顺手修一下维基百科 # 顺手修一下维基百科
# Wikipedia Start # Wikipedia Start
127.0.0.1 en.wikipedia.org
127.0.0.1 zh.wikipedia.org #中文维基百科桌面版 127.0.0.1 zh.wikipedia.org #中文维基百科桌面版
127.0.0.1 en.m.wikipedia.org
127.0.0.1 zh.m.wikipedia.org
127.0.0.1 zh-yue.wikipedia.org #粤文维基百科桌面版 127.0.0.1 zh-yue.wikipedia.org #粤文维基百科桌面版
127.0.0.1 wuu.wikipedia.org #吴语维基百科桌面版 127.0.0.1 wuu.wikipedia.org #吴语维基百科桌面版
127.0.0.1 ug.wikipedia.org #维吾尔文维基百科桌面版 127.0.0.1 ug.wikipedia.org #维吾尔文维基百科桌面版
127.0.0.1 ja.wikipedia.org #日文维基百科桌面版 127.0.0.1 ja.wikipedia.org #日文维基百科桌面版
127.0.0.1 zh.wikinews.org #中文维基新闻桌面版 127.0.0.1 zh.wikinews.org #中文维基新闻桌面版
# Wikipedia End # Wikipedia End
# 顺手修一下Steam
# Steam
127.0.0.1 store.steampowered.com
127.0.0.1 steamcommunity.com
# Steam end

View File

@ -1,4 +1,4 @@
#本地化的登陆/注册界面的人机验证插件 #www.google.com域名仅用于登陆验证
#如果你不需要这个功能,请把下一行删掉 #如果你不需要这个功能,请把下一行删掉
127.0.0.1 www.google.com 127.0.0.1 www.google.com
@ -34,10 +34,19 @@
# 顺手修一下维基百科 # 顺手修一下维基百科
# Wikipedia Start # Wikipedia Start
127.0.0.1 en.wikipedia.org
127.0.0.1 zh.wikipedia.org #中文维基百科桌面版 127.0.0.1 zh.wikipedia.org #中文维基百科桌面版
127.0.0.1 en.m.wikipedia.org
127.0.0.1 zh.m.wikipedia.org
127.0.0.1 zh-yue.wikipedia.org #粤文维基百科桌面版 127.0.0.1 zh-yue.wikipedia.org #粤文维基百科桌面版
127.0.0.1 wuu.wikipedia.org #吴语维基百科桌面版 127.0.0.1 wuu.wikipedia.org #吴语维基百科桌面版
127.0.0.1 ug.wikipedia.org #维吾尔文维基百科桌面版 127.0.0.1 ug.wikipedia.org #维吾尔文维基百科桌面版
127.0.0.1 ja.wikipedia.org #日文维基百科桌面版 127.0.0.1 ja.wikipedia.org #日文维基百科桌面版
127.0.0.1 zh.wikinews.org #中文维基新闻桌面版 127.0.0.1 zh.wikinews.org #中文维基新闻桌面版
# Wikipedia End # Wikipedia End
# 顺手修一下Steam
# Steam
127.0.0.1 store.steampowered.com
127.0.0.1 steamcommunity.com
# Steam end

View File

@ -212,24 +212,22 @@ http {
} }
} }
upstream wikipedia-server {
server 198.35.26.96:443;
server 103.102.166.224:443;
}
server { server {
listen 443 ssl; listen 443 ssl;
server_name zh.wikipedia.org; server_name *.wikipedia.org;
server_name zh-yue.wikipedia.org; server_name *.m.wikipedia.org;
server_name wuu.wikipedia.org;
server_name ug.wikipedia.org;
server_name ja.wikipedia.org;
server_name zh.wikinews.org;
server_name zh.m.wikipedia.org;
server_name ug.m.wikipedia.org;
server_name zh.m.wikinews.org;
ssl on; ssl on;
ssl_certificate ca/pixiv.net.crt; ssl_certificate ca/pixiv.net.crt;
ssl_certificate_key ca/pixiv.net.key; ssl_certificate_key ca/pixiv.net.key;
location / { location / {
proxy_pass https://103.102.166.224/; proxy_pass https://wikipedia-server/;
proxy_set_header Host $http_host; proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real_IP $remote_addr; proxy_set_header X-Real_IP $remote_addr;