mirror of
https://github.com/mashirozx/Pixiv-Nginx.git
synced 2024-11-16 18:58:12 +08:00
8dccf52577
1. 优化配置文件 2. 非cloudflare无需显式指定ip,cloudflare代理必须传递SNI,无解 3. 删除cloudflare代理的站点:e-hentai.org 4. 使用无污染dns:清华大学dns解析正常
144 lines
4.1 KiB
Plaintext
144 lines
4.1 KiB
Plaintext
upstream pixiv {
|
||
server 210.140.131.200:443;
|
||
server 210.140.131.202:443;
|
||
server 210.140.131.220:443;
|
||
server 210.140.131.223:443;
|
||
server 210.140.131.226:443;
|
||
}
|
||
|
||
server {
|
||
listen 80 default_server;
|
||
rewrite ^(.*) https://$host$1 permanent;
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name forums.e-hentai.org;
|
||
|
||
ssl_certificate ca/pixiv.net.crt;
|
||
ssl_certificate_key ca/pixiv.net.key;
|
||
|
||
client_max_body_size 50M;
|
||
|
||
location / {
|
||
proxy_pass https://94.100.18.243:443;
|
||
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 pixiv.net;
|
||
server_name ssl.pixiv.net;
|
||
server_name accounts.pixiv.net;
|
||
server_name touch.pixiv.net;
|
||
server_name oauth.secure.pixiv.net;
|
||
server_name www.pixiv.net;
|
||
server_name app-api.pixiv.net;
|
||
|
||
|
||
ssl_certificate ca/pixiv.net.crt;
|
||
ssl_certificate_key ca/pixiv.net.key;
|
||
|
||
client_max_body_size 50M;
|
||
|
||
location / {
|
||
# cloudflare代理需要SNI,IP需要指定为非cloudflare
|
||
proxy_pass https://pixiv;
|
||
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;
|
||
|
||
resolver 101.6.6.6:5353 valid=300s ipv6=on;
|
||
|
||
ssl_certificate ca/pixiv.net.pem;
|
||
ssl_certificate_key ca/pixiv.net.key;
|
||
|
||
location / {
|
||
proxy_pass https://$http_host;
|
||
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://$http_host;
|
||
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 www.google.com;
|
||
|
||
|
||
ssl_certificate ca/pixiv.net.crt;
|
||
ssl_certificate_key ca/pixiv.net.key;
|
||
|
||
location ^~ /recaptcha/ {
|
||
rewrite ^(.*)$ https://www.recaptcha.net$1 break;
|
||
}
|
||
|
||
location / {
|
||
default_type text/html;
|
||
charset utf-8;
|
||
return 200 'Pixiv-Nginx提醒:本工具默认代理了www.google.com,用于加载P站登陆时的验证码插件,如果你有方法正常访问www.google.com,并且不希望看到这个页面,那么将 <code>C:\Windows\System32\drivers\etc\hosts</code> 中 <code>127.0.0.1 www.google.com</code> 的那行记录删除即可。如果删除后刷新网页还是看到这个页面,请先清除一下浏览器缓存。';
|
||
}
|
||
}
|
||
|
||
server {
|
||
listen 443 ssl;
|
||
server_name *.steamcommunity.com;
|
||
server_name steamcommunity.com;
|
||
server_name *.steampowered.com;
|
||
server_name steampowered.com;
|
||
server_name *.archiveofourown.org;
|
||
server_name archiveofourown.org;
|
||
server_name nyaa.si;
|
||
server_name *.nyaa.si;
|
||
server_name *.wikimedia.org;
|
||
server_name wikimedia.org;
|
||
server_name *.wikipedia.org;
|
||
server_name *.m.wikipedia.org;
|
||
server_name *.pixivsketch.net;
|
||
server_name *.pximg.net;
|
||
server_name *.pixiv.net;
|
||
|
||
ssl_certificate ca/pixiv.net.crt;
|
||
ssl_certificate_key ca/pixiv.net.key;
|
||
|
||
location / {
|
||
# 无污染DNS解析,无需显式指定IP
|
||
resolver 101.6.6.6:5353 valid=300s;
|
||
proxy_pass https://$http_host$1;
|
||
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;
|
||
}
|
||
}
|