Skip to content

Commit

Permalink
perf: update nginx to 1.16.1 and optimize configuration files
Browse files Browse the repository at this point in the history
  • Loading branch information
mashirozx committed Apr 16, 2020
1 parent 055cdfd commit ef8d815
Show file tree
Hide file tree
Showing 12 changed files with 950 additions and 320 deletions.
289 changes: 1 addition & 288 deletions conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -35,292 +35,5 @@ http {

#gzip on;

upstream www-pixiv-net {
server 210.140.131.223:443;
server 210.140.131.225:443;
server 210.140.131.220:443;
}

upstream sketch-pixiv-net {
server 210.140.174.37:443;
server 210.140.170.179:443;
server 210.140.175.130:443;
}

upstream sketch-hls-server {
server 210.140.214.211:443;
server 210.140.214.212:443;
server 210.140.214.213:443;
}

upstream imgaz-pixiv-net {
server 210.140.131.145:443;
server 210.140.131.144:443;
server 210.140.131.147:443;
server 210.140.131.153:443;
}

upstream i-pximg-net {
server 210.140.92.140:443;
server 210.140.92.137:443;
server 210.140.92.139:443;
server 210.140.92.142:443;
server 210.140.92.134:443;
server 210.140.92.141:443;
server 210.140.92.143:443;
server 210.140.92.136:443;
server 210.140.92.138:443;
server 210.140.92.144:443;
server 210.140.92.145:443;
}

server {
listen 80 default_server;
rewrite ^(.*) https://$host$1 permanent;
}

server {
listen 443 ssl;
server_name pixiv.net;
server_name www.pixiv.net;
server_name ssl.pixiv.net;
server_name accounts.pixiv.net;
server_name touch.pixiv.net;
server_name oauth.secure.pixiv.net;

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

client_max_body_size 50M;

location / {
proxy_pass https://www-pixiv-net;
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 i.pximg.net;

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

location / {
proxy_pass https://i-pximg-net;
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 sketch.pixiv.net;

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

location / {
proxy_pass https://sketch-pixiv-net;
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;
}

# Proxying WebSockets
location /ws/ {
proxy_pass https://sketch-pixiv-net;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
}

server {
listen 443 ssl;
server_name *.pixivsketch.net;

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

location / {
proxy_pass https://sketch-hls-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 factory.pixiv.net;

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

location / {
proxy_pass https://210.140.131.180/;
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 dic.pixiv.net;
server_name en-dic.pixiv.net;
server_name sensei.pixiv.net;
server_name fanbox.pixiv.net;
server_name payment.pixiv.net.pixiv.net;

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

location / {
proxy_pass https://210.140.131.222/;
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 imgaz.pixiv.net;
server_name comic.pixiv.net;
server_name novel.pixiv.net;
server_name source.pixiv.net;
server_name i1.pixiv.net;
server_name i2.pixiv.net;
server_name i3.pixiv.net;
server_name i4.pixiv.net;

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

location / {
proxy_pass https://imgaz-pixiv-net;
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;
}
}

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://23.61.176.149/;
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://104.112.84.145/;
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 *.archiveofourown.org;
server_name archiveofourown.org;

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

location / {
proxy_pass https://104.153.64.122/;
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;
}
}

include pixiv.conf;
}
Loading

0 comments on commit ef8d815

Please sign in to comment.