Skip to content

Commit

Permalink
wildcard support for wikipedia & steam community
Browse files Browse the repository at this point in the history
  • Loading branch information
mashirozx committed Jun 27, 2019
1 parent 5e90308 commit 840ea9b
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 24 deletions.
58 changes: 48 additions & 10 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -248,24 +248,62 @@ http {
}
}

upstream wikipedia-server {
server 198.35.26.96:443;
server 103.102.166.224:443;
}

server {
listen 443 ssl;
server_name *.wikipedia.org;
server_name *.m.wikipedia.org;

ssl on;
ssl_certificate ca/pixiv.net.crt;
ssl_certificate_key ca/pixiv.net.key;

location / {
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 zh.wikipedia.org;
server_name zh-yue.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;
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://103.102.166.224/;
proxy_pass https://23.77.18.43/;
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;
Expand Down
13 changes: 11 additions & 2 deletions hosts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#本地化的登陆/注册界面的人机验证插件
#www.google.com域名仅用于登陆验证
#如果你不需要这个功能,请把下一行删掉
127.0.0.1 www.google.com

Expand Down Expand Up @@ -34,10 +34,19 @@

# 顺手修一下维基百科
# Wikipedia Start
127.0.0.1 en.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 wuu.wikipedia.org #吴语维基百科桌面版
127.0.0.1 ug.wikipedia.org #维吾尔文维基百科桌面版
127.0.0.1 ja.wikipedia.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
13 changes: 11 additions & 2 deletions 配置文件(非Windows用户使用)/hosts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#本地化的登陆/注册界面的人机验证插件
#www.google.com域名仅用于登陆验证
#如果你不需要这个功能,请把下一行删掉
127.0.0.1 www.google.com

Expand Down Expand Up @@ -34,10 +34,19 @@

# 顺手修一下维基百科
# Wikipedia Start
127.0.0.1 en.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 wuu.wikipedia.org #吴语维基百科桌面版
127.0.0.1 ug.wikipedia.org #维吾尔文维基百科桌面版
127.0.0.1 ja.wikipedia.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
18 changes: 8 additions & 10 deletions 配置文件(非Windows用户使用)/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -212,24 +212,22 @@ http {
}
}

upstream wikipedia-server {
server 198.35.26.96:443;
server 103.102.166.224:443;
}

server {
listen 443 ssl;
server_name zh.wikipedia.org;
server_name zh-yue.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;
server_name *.wikipedia.org;
server_name *.m.wikipedia.org;

ssl on;
ssl_certificate ca/pixiv.net.crt;
ssl_certificate_key ca/pixiv.net.key;

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;
Expand Down

0 comments on commit 840ea9b

Please sign in to comment.