神代綺凛

[Pixiv] Nginx 真·反代P站
解决了一年前的我无法解决的世纪难题(x 深刻意识到,很多以前自己认为无解的问题并不是真的无解,只是自己的知识面不够...
扫描右侧二维码阅读全文
08
2018/11

[Pixiv] Nginx 真·反代P站

解决了一年前的我无法解决的世纪难题(x

深刻意识到,很多以前自己认为无解的问题并不是真的无解,只是自己的知识面不够而无法意识到问题的核心所在罢了。

总结起来就一个字:菜

Head Pic: 「Halloween」/「鳥成」のイラスト [pixiv]

前言

本文所述的所有内容仅供交流学习,请勿实际做出任何违反国家法律的行为!

此方案为真的反代,而不是在本地反代以绕过 SNI 审查的方法(Mashiro - PIXIV网页版及客户端访问恢复指南

请不要在互联网上公开自己搭建的反代站,P 站可能会发邮件到您的主机商投诉。如果您因为此种原因导致 VPS 服务等被终止,本人不负任何责任。

准备工作

  1. 一台没被P站屏蔽的主机
    众所周知 Vultr 大部分IP段都被P站屏蔽
  2. 一个船新的域名
    其实随意啦,用自己域名的二级来弄也可,只是域名会变得比较长
    后续均以example.com来指代我们使用的域名,请灵性代换
  3. 因为反代域名较多,最好使用支持泛域名的 SSL 证书,这里我们自然首推 Let's Encrypt

域名及证书

需要使用哪些域?

在反代时我们需要用到以下几个域

如果你愿意使用一个船新域名专门反代:

example.com
*.example.com
*.pximg.example.com
  • example.com
    随意,你可以放点自己的东西做一些伪装或者说明,或者直接 301 到www.example.com
  • *.example.com
    用于反代对齐*.pixiv.net
  • *.pximg.example.com
    用于反代对齐*.pximg.net,其实该域名中的pximg也可以替换成其他的字符串,只要不与P站的二级域名服务产生冲突即可

如果你想用一个自己正在使用的域名反代并且不想影响该域名的其他服务:

pixiv.example.com
*.pixiv.example.com
*.pximg.example.com

各自作用同上,在后续配置上灵性修改即可

获取证书

如果你愿意套 CloudFlare,你可以跳过这一节

使用 acme 的 DNS API 方式进行挑战验证来签发证书是最方便的

参考以下文章

在配置好 API 之后我们使用这样的命令即可签发一个我们想要的三域名合一的证书了,并且还能自动续签,岂不美哉

~/.acme.sh/acme.sh --issue --dns dns_cx -d example.com -d '*.example.com' -d '*.pximg.example.com'

Nginx

不要使用 Tengine 等 Nginx 分支版本,在某些模块上可能会有一些奇怪的差异与问题

基础配置

这里仅列出关键配置,通常配置例如listenexpirescache以及 SSL 之类的不会写出,自行添加

# *.example.com
server
{
    server_name ~^([^.]+)\.example\.com$;
    set $domain $1;

    resolver 8.8.8.8;

    location ~ .*
    {
        proxy_set_header Host $domain.pixiv.net;
        proxy_set_header Referer "https://www.pixiv.net";
        proxy_cookie_domain pixiv.net example.com;
        proxy_pass https://$domain.pixiv.net;
        proxy_ssl_server_name on;
        proxy_set_header Accept-Encoding "";
        proxy_redirect https://accounts.pixiv.net/ https://accounts.example.com/;

        sub_filter "i-cf.pximg.net" "i.example.com";
        sub_filter "pixiv.net" "example.com";
        sub_filter "pximg.net" "pximg.example.com";
        # 防止错误上报暴露站点
        sub_filter "js_error.php" "block_js_error";
        # 防止谷歌服务暴露站点,同时也可以加快网站加载
        sub_filter "www.google" "block_google";
        sub_filter_once off;
        sub_filter_types *;
    }
}

# *.pximg.example.com
server
{
    server_name ~^([^.]+)\.pximg\.example\.com$;
    set $domain $1;

    resolver 8.8.8.8;

    location ~ .*
    {
        proxy_set_header Host $domain.pximg.net;
        proxy_set_header Referer "https://www.pixiv.net";
        proxy_pass https://$domain.pximg.net;
        proxy_ssl_server_name on;
        proxy_set_header Accept-Encoding "";

        sub_filter "i-cf.pximg.net" "i.example.com";
        sub_filter "pixiv.net" "example.com";
        sub_filter "pximg.net" "pximg.example.com";
        # 防止错误上报暴露站点
        sub_filter "js_error.php" "block_js_error";
        # 防止谷歌服务暴露站点,同时也可以加快网站加载
        sub_filter "www.google" "block_google";
        sub_filter_once off;
        sub_filter_types *;
    }
}

详解

  • server_nameset
    使用正则表达式匹配以方便直接提取出我们要反代的二级域名
  • resolver
    必要,指定域名解析所用 DNS,因为在后续proxy_pass中我们要反代的域名是由$domain决定,本身是不定的,Nginx 必须被指定 DNS 才能处理域名解析
  • proxy_cookie_domain
    改变反代后返回的 header 中 set-cookie 里 cookie 对应的域名,只在*.example.com中需要,是解决登陆问题的关键,如想了解后续文章会解释
  • proxy_ssl_server_name
    由于 P 站开始上 CF 了,其 TLS 启用了 SNI,因此必须指定此项为on,否则会握手失败
  • proxy_set_header Referer
    设置 header 中的 Referer,主要目的是解决i.pximg.net的防盗链问题,以及www.pixiv.net的部分 API 的 Referer 验证问题
  • proxy_set_header Accept-Encoding
    将接受的压缩编码设为空,即不接受压缩,因为sub_filter无法对压缩过的内容起效
  • proxy_redirect
    将返回原站 302 的请求进行重定向
  • sub_filter
    将反代后得到的内容进行字符串替换,以保证链接域名等与反代域名一致
  • sub_filter_types
    必须设置为*,否则默认对于 API 返回的 json 内容等不会进行替换,会导致依靠 ajax 运作的一些功能的异常

增强隐蔽性(建议)

防止被搜索引擎收录

在 Nginx 配置中向每个 server 添加此句

    if ($http_user_agent ~* "qihoobot|Baiduspider|Googlebot|Googlebot-Mobile|Googlebot-Image|Mediapartners-Google|Adsbot-Google|Feedfetcher-Google|Yahoo! Slurp|Yahoo! Slurp China|YoudaoBot|Sosospider|Sogou spider|Sogou web spider|MSNBot|ia_archiver|Tomato Bot|^$") {  
        return 403;
    }

请加到set $domain $1;这句之后,因为该配置也使用了正则表达式,会导致$1改变

禁止大陆外IP访问

由于反代P站的受众只可能为大陆内用户,因此我们完全可以禁止大陆外IP访问反代站,同时还能防止P站检测投诉

但请注意,这个方案是对整台 VPS 的80443端口生效,这意味着你如果同时在 VPS 上布置了其他站点,他们也将无法被大陆外用户访问

如果需要仅对反代站点生效,请自行百度参考“nginx geoip”,或者使用后面所述的套 CloudFlare 的方式

参考步骤:

  1. 安装 ipset
    # Debian / Ubuntu
    apt-get -y install ipset
    # CentOS
    yum -y install ipset
  2. 创建一个 ipset 并添加大陆IP作为白名单
    ipset -N cnip hash:net
    for i in $(curl https://raw.githubusercontent.com/17mon/china_ip_list/master/china_ip_list.txt); do ipset -A cnip $i; done
    # 如果你想要添加单个IP x.x.x.x 进此白名单
    ipset -A cnip x.x.x.x/32
  3. 写入防火墙规则(顺序十分重要,请不要改变执行顺序)
    iptables -I INPUT -p tcp --dport 443 -j DROP
    iptables -I INPUT -p tcp --dport 80 -j DROP
    iptables -I INPUT -p tcp -m set --match-set cnip src -j ACCEPT

套 CloudFlare

除了上述方案外,我自己是套了层 CloudFlare,并设置了防火墙规则来阻止非国内以及搜索引擎爬虫访问

这样有个优点,一是 SSL 证书都是 Cloudflare 自动签发和续期的,因此使用 Flexible SSL 选项,然后源反代站就不需要操心证书的事了,直接使用 HTTP;二是 Cloudflare 的防火墙可以实现上面提到的屏蔽国内 IP 以及搜索引擎的功能,不需要自己去维护

当然这样是有缺点的,就是设置 DNS 记录

Cloudflare CDN不支持设置泛域名记录

因此我们只能一条一条记录加,首次部署简直是要了命,以下列出主站功能相关域名:

www.pixiv.net
accounts.pixiv.net
source.pixiv.net
imp.pixiv.net

i.pximg.net
s.pximg.net
pixiv.pximg.net

其他的例如小说、直播等等我个人使用频率很低所以我就不考虑了,当然如果你有需求就自己找域名吧(

局限性

不能使用绑定的社交账号的登录方式

帐号可能会出现需要 reCAPTCHA 验证导致无法登录,无解,只能自己将原站已登录的 cookie 导出,替换域名,然后导入反代站来进行登录

可能存在尚未发现的问题

解决登陆问题的关键

这个问题困扰我一年了,以前我尝试反代的时候,登录会提示“无效的服务器”而无法登陆,直到最近才发现真正原因

我通过搜索引擎查找了很多文章,直到遇见了这篇
模拟登录pixiv.net后续 - ことりのおやつにしてやるぞー!

之前我认为,登录时唯一要注意的只有postKey,而代码中的获取 cookie 的操作提醒了我,我的直觉告诉我登录失败是跟 cookie 有关

于是我又翻看了一下 GET 登陆页面时的 header,原来是有 set-cookie 的,而我之前一直从登录相关 js 的操作入手因此没有注意到这个细节

根据这个思路我试着自己用 Nodejs 写了个模拟登录来尝试

const Axios = require('axios');
const Qs = require('qs');

async function test() {
    let postKey, cookie = '';

    //访问登录页
    await Axios.get('https://accounts.pixiv.net/login?lang=zh&source=pc&view_type=page&ref=wwwtop_accounts_index', {
        headers: {
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"
        }
    }).then(res => {
        //获取登录页 cookie 和 postKey
        for (let set of res.headers['set-cookie']) {
            cookie += '; ' + set.split(';')[0];
        }
        cookie = cookie.substr(2);
        postKey = /"pixivAccount\.postKey":"([0-9a-z]+)"/.exec(res.data)[1];
    });

    //向登录 API 发送 POST
    await Axios.post('https://accounts.pixiv.net/api/login?lang=zh', Qs.stringify({
        pixiv_id: '邮箱',
        password: '密码',
        captcha: '',
        g_recaptcha_response: '',
        post_key: postKey,
        source: 'pc',
        ref: 'wwwtop_accounts_index',
        return_to: 'https://www.pixiv.net/'
    }), {
        headers: {
            "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36",
            "content-type": "application/x-www-form-urlencoded",
            "accept": "application/json",
            "cookie": cookie
        }
    }).then(res => {
        console.log(res.data);
        console.log(res.headers['set-cookie']);
    });
}

test();

返回内容与返回 header 中的 set-cookie:

可喜可贺,也就是说确实是 cookie 的锅

准确地说是因为 sub_filter 只能替换 response 中的内容,我没有想到 set-cookie 的 domain 由于是 .pixiv.net,不会被任何机制自动替换,与反代域名不同,没有 set 上,因此导致发出登录 POST 的时候没有携带上这个 cookie

知道了问题核心所在,那么解决方案自然也就不难想到了,经过搜索我找到了 Nginx 官方文档中有提到 proxy_cookie_domain

Syntax:
proxy_cookie_domain off;
proxy_cookie_domain domain replacement;

Default:
proxy_cookie_domain off;

Context: http, server, location

This directive appeared in version 1.1.15.

Sets a text that should be changed in the domain attribute of the "Set-Cookie" header fields of a proxied server response.

问题解决√

而且没想到解决方式竟如此简单,只不过是加一行配置的事

搬瓦工VPS优惠套餐,建站稳如狗,支持支付宝,循环出账94折优惠码BWH3HYATVBJW
年付$47CN2线路,1核/1G内存/20G硬盘/1T@1Gbps【点击购买
季付$47CN2 GIA线路,1核/1G内存/20G硬盘/1T@2.5Gbps【点击购买
Last modification:March 5th, 2023 at 01:11 pm
If you think my article is useful to you, please feel free to appreciate

Leave a Comment Cancel reply

142 comments

  1. wang666233  Android 10(Android 10) / Google Chrome 115.0.0.0(Google Chrome 115.0.0.0)
    现在这个方法还能用不?我用一台hk的vps照着搭建后可以出首页,就是让选登录方式的页面。但这个页面似乎加载不完全,图片资源包括背景大图都加载不出来。点了登录选项后网页也是一直白屏,是p站更新了什么东西还是我设置有误?求解答
    1. wang666233  Android 10(Android 10) / Google Chrome 115.0.0.0(Google Chrome 115.0.0.0)
      @wang666233 见笑了,是我自己有一行配置有误,已经解决
  2. Wpol  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 107.0.0.0(Google Chrome 107.0.0.0)
    现在 https://accounts.pixiv.net/api/login?lang=zh 这个api好像不能用了,404了

    以及最后的 加一行配置 ,是指示例代码中的 proxy_cookie_domain pixiv.net example.com;

    如果模拟登录可以使用的话,是不是可以模拟登录获取到的cookie直接通过js放入反代网站中呢

    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 108.0.0.0(Google Chrome 108.0.0.0)
      @Wpol 是,配置 proxy_cookie_domain 就可以直接使用反代后的网站登录,不过我也不知道现在还能不能反代后登录,我自己的反代站也早就关了

      拿 cookie 不需要使用文中的模拟登录代码,你只需要直接在P站登录就能拿了

  3. djkcyl  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 104.0.5112.102(Google Chrome 104.0.5112.102)
    如果我的域名没有一级只有二级好像是用不了的
    例如我想 pixiv.xxxx.com
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 104.0.0.0(Google Chrome 104.0.0.0)
      @djkcyl 其实可以写利用路径去反代的规则,例如 pixiv.xxxx.com/accounts/ pixiv.xxxx.com/i_pximg/ 这样,不过得踩点坑了
  4. Catowen  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 100.0.4896.75(Google Chrome 100.0.4896.75)
    大佬,我反代之后登录会有Google验证,我用sub_filter和proxy_cookie都替换原来的密匙为我的,但依旧显示“需要网站所有者处理的错误:网站密钥的网域无效”,怎么办啊
    1. 神代綺凛  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 101.0.4951.54(Google Chrome 101.0.4951.54)
      @Catowen 登录最终是 pixiv 的服务器来验证 google 验证码的啊,因为是自己反代的,域名不是原来的,所以是没办法过的
  5. ECS  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 99.0.4811.0(Google Chrome 99.0.4811.0)
    大佬,反代gdrive 为什么访问gdrive.xxx.net(反代到drive.google.com)sub_filter "googleusercontent.com" "guc.xxx.net";没用
    1. ckyf1134  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 105.0.0.0(Google Chrome 105.0.0.0)
      @ECS 有没有一种可能,谷歌是IP黑洞
  6. 松江腊雪  Mac OS X(Mac OS X) / Safari 14.1.1(Safari 14.1.1)
    直接502了,好烦
  7. 飞龙project  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 88.0.4324.150(Google Chrome 88.0.4324.150)
    问下大佬,为什么套了cf之后还是会提示“此网站无法提供安全连接”?是ssl的锅么
    1. ECS  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 99.0.4811.0(Google Chrome 99.0.4811.0)
      @飞龙project cf的ssl最多支持一级子域名,如果要三级等域名需要购买付费计划添加自定义证书。
  8. 未知狐  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.116(Google Chrome 83.0.4103.116)
    很有趣,不过我现在不是在搞Pixiv的反代,我要用国外VPS反代国内的Discuz3.4搭建的论坛
  9. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 81.0.4044.138(Google Chrome 81.0.4044.138)
    现在好像因为ip的问题还是什么。。。有些时候访问页面必须要谷歌验证emmmm。。配置里带cf验证后的cookies勉强解决emmmm
  10. zeruns  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 78.0.3904.108(Google Chrome 78.0.3904.108)
    我还以为你说的P站是P**nHub
  11. 洛伊真天  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 81.0.4044.122(Google Chrome 81.0.4044.122)
    大佬,我代理是成功了,但是在看图片的页面一向下滚动就显示 “显示页面时发生错误”,这又是哪里不对?
  12. Hakula  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.132(Google Chrome 80.0.3987.132)
    该评论仅登录用户及评论双方可见
    1. Hakula  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.163(Google Chrome 80.0.3987.163)
      @Hakula 突然又好了,没事了 (估计是 Cloudflare 侧的问题
  13. emmmm  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 47.0.2526.73(Google Chrome 47.0.2526.73)
    呃,那个问一下,最后的登录显示reCAPTCHA如何自己修改cookie?
    可以说的详细的嘛?
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
      @emmmmCookie-Editor 之类的扩展,在原站登录后将 cookie 导出,然后用文本编辑器批量替换下域名,再到你的反代站导入
      1. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
        @神代綺凜 咱是用add_header Set-Cookie的emmmmm但是发现好像没那么好用,进入要先刷新一下。。看别的大佬的反代都没有在本地设置cookies。。。一是不知道提取哪个cookies。。提取了PHPSESSId,device_toke和yuid_b=gokoZTA;。。。二是觉得有更好的办法。。。无奈技术不过关。。0基础全靠百度。。。。
        1. 神代綺凜  Mac OS X 10.15.3(Mac OS X 10.15.3) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
          @LYM 你如果在 nginx 上设置你自己的 cookie 那岂不是别人知道网址的就可以随便操作你帐号了……除非你自己再加个 authentication

          而且如果真要这么做,应该是反代时直接向原站发送 cookie,即proxy_set_header Cookie xxx,而不是在返回时add_header Set-Cookie xxx,这样当然就要刷新一次咯,因为第一次访问之后才会被 set-cookie

          本地设置 cookie 这个,你就原站登录然后导出,就拿到所有 cookie,替换掉域名导入你反代站不就行了,相当于原样照搬,这样也不用管它实际验证的是哪个 cookie

          1. C@ro1  Mac OS X(Mac OS X) / Safari 13.1.2(Safari 13.1.2)
            @神代綺凜 PHPSESSID需要加的,不然没用。
          2. null  Mac OS X(Mac OS X) / Safari 13.1(Safari 13.1)
            @神代綺凜 请问下,为什么反代站直接发cookie还需要替换域名呢?
            1. 神代綺凜  Mac OS X 10.15.4(Mac OS X 10.15.4) / Google Chrome 81.0.4044.138(Google Chrome 81.0.4044.138)
              @null 因为反代从原站拿到的 set-cookie 里的 cookie 域名仍然是原站的,默认情况下 nginx 并不会自动帮你替换
              1. null  Mac OS X(Mac OS X) / Safari 13.1(Safari 13.1)
                @神代綺凜 啊,谢谢,但我可能没说清楚,用proxy_set_header的话,cookie应该不经过浏览器,大概也就不用替换?
                因为p站cookie里没有域名我也没法测试到底要不要替换
                1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
                  @null cookie 的域名是一个属性而不是存在于它的值里面,在 F12 的 Application - Cookies 里能看的很清楚,你也可以试试通过 postman 之类的请求调试软件看 header 里面 set-cookie 的内容

                  nginx 反代时如果你不指定proxy_cookie_domain,源站 response 里的 header 会被直接照搬过来成为反代 response 的 header,cookie 域名就和反代站域名不一致了

                2. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 83.0.4103.61(Google Chrome 83.0.4103.61)
                  @null 啊,我之前回复的时候没看上下文,可能有点不明所以

                  但看了上下文之后我更搞不懂要怎么回答了

                  1. null  Mac OS X(Mac OS X) / Safari 13.1(Safari 13.1)
                    @神代綺凜 啊这样..鉴于我语文实在不咋地,的确是有点跨服聊天..不过现在已经理解了..感谢解释
          3. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
          4. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
            @神代綺凜 谢谢大佬教qwq因为咱是零基础全靠百度的emmmmOωO
  14. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
    现在好像用的直接502了qwq
    是咱配置的问题吗。。
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
      @LYM 我更新了下配置,照着加proxy_ssl_server_name这行,两块都加
      1. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
        @神代綺凜 话说dnspod直接只选择境内解析应该可以防止非大陆ip访问达到保护站点的作用吧qwq
        1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
          @LYM 不能,如果在国外用国内 DNS 解析就可以绕过这个限制,或者你在国内用国外 DNS 就无法访问
      2. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
        @神代綺凜 谢谢大佬qwq
        1. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
          @LYM 不过好像不能嵌套在iflame里qwq。。。。 本来想嵌套在博客里的-_-||
          1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
            @LYM X-Frame-Options,自己百度
            1. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 80.0.3987.149(Google Chrome 80.0.3987.149)
              @神代綺凜 折腾了半天、、、、放弃。。。
  15. 安忆  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 79.0.3945.88(Google Chrome 79.0.3945.88)
    轮子越写越大了 不算证书段等其他配置块的情况下已经快1200行了,是我搞过最长的Nginx的配置了

    WikiMirror
    1. 神代綺凜  Mac OS X 10.14.6(Mac OS X 10.14.6) / Google Chrome 79.0.3945.88(Google Chrome 79.0.3945.88)
      @安忆
    2. 安忆  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 79.0.3945.88(Google Chrome 79.0.3945.88)
      @安忆 emmm,限制了referer(用鼠标中键单击就好了
  16. 北辰无昼  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 49.0.2623.87(Google Chrome 49.0.2623.87)
    看上去好高大上。。。但是本人对于电脑基本是萌新级别。。。楼主有没有那种电脑小白也能懂的方法哇?,,,好多都看不懂。不过我还有句话想问,租借了外网服务器,在电脑是新拆封没有动过任何设置的情况下能百分百保证能上p站吗?
    1. 北辰无昼  Windows 7 x64 Edition(Windows 7 x64 Edition) / Google Chrome 49.0.2623.87(Google Chrome 49.0.2623.87)
      @北辰无昼 额好吧,最后就是想直接问一下,能否在有租借外网服务器的情况下跳过以上步骤,链接外网ip直接用pixiv,因为手机端我是直接用DNS changer修改DNS地域名可以连p站(虽然好像听说有dns污染我还是连上了就是网速比较慢)
      1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 78.0.3904.108(Google Chrome 78.0.3904.108)
        @北辰无昼 那不就自己搭个代理吗……
  17. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3809.132(Google Chrome 76.0.3809.132)
    该评论仅登录用户及评论双方可见
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3809.132(Google Chrome 76.0.3809.132)
      @LYM
      该评论仅登录用户及评论双方可见
  18. LYM  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3809.132(Google Chrome 76.0.3809.132)
    唔,我觉得,要是宝塔设置密码访问是不是不需要屏蔽国外ip之类的
  19. moyu  Mac OS X 10.14.6(Mac OS X 10.14.6) / Google Chrome 76.0.3809.87(Google Chrome 76.0.3809.87)
    不行,用你搭的和我自己搭的登录都会出现:"需要网站所有者处理的错误:网站密钥的网域无效",无解了。
    1. 神代綺凜  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3809.100(Google Chrome 76.0.3809.100)
      @moyu 在最新的几个评论我都有说过,我就不再说一遍了
  20. 猫酱  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3809.100(Google Chrome 76.0.3809.100)
    看了之后卡在配置nginx上,不懂怎么改成能用的亚子
    1. 神代綺凜  Mac OS X 10.14.6(Mac OS X 10.14.6) / Google Chrome 76.0.3809.100(Google Chrome 76.0.3809.100)
      @猫酱 需要对 nginx 比较熟悉,自行发挥的成分比较大
      1. 猫酱  Windows 10 x64 Edition(Windows 10 x64 Edition) / Google Chrome 76.0.3809.100(Google Chrome 76.0.3809.100)
        @神代綺凜 倒是成功弄好了,不过reCAPTCHA验证使得账号无法登陆
        1. 神代綺凜  Mac OS X 10.14.6(Mac OS X 10.14.6) / Google Chrome 76.0.3809.100(Google Chrome 76.0.3809.100)
          @猫酱 嗯,这个目前没有办法了