tonquer / picacg-qt

哔咔漫画, PicACG comic PC client(Windows, Linux, MacOS)
GNU Lesser General Public License v3.0
3.4k stars 181 forks source link

JP反代突发性失效 #203

Closed MomentQYC closed 1 year ago

MomentQYC commented 1 year ago

操作系统(如MacOS 10.15)

Zorin 16.2 Pro (Ubuntu 20.04.1)

网络环境(移动,联通,电信,移动宽带,联通宽带,电信宽带,等等..)

移动

问题描述(简要描述发生的问题)

JP反代突然失效

复现步骤(详细描述导致问题产生的操作步骤,如果能稳定复现)

打开并登录

日志提交(问题截图或者日志,日志在设置中设置为INFO,在帮助界面打开日志目录)

image image

tonquer commented 1 year ago

流量被刷完了,下个月恢复

MomentQYC commented 1 year ago

流量被刷完了,下个月恢复

一般情况下月流量大致多少呢

tonquer commented 1 year ago

流量被刷完了,下个月恢复

一般情况下月流量大致多少呢

1000G

MomentQYC commented 1 year ago

请问是通过什么方法反代的呢,或许可以试着自己整一个减轻服务压力

tonquer commented 1 year ago

请问是通过什么方法反代的呢,或许可以试着自己整一个减轻服务压力

目前用的是nginx反代哔咔域名,得有服务器才行

MomentQYC commented 1 year ago

请问是通过什么方法反代的呢,或许可以试着自己整一个减轻服务压力

目前用的是nginx反代哔咔域名,得有服务器才行

配置文件可以看一下吗

tonquer commented 1 year ago

Api反代

server {
  listen 80;
    set_real_ip_from 127.0.0.1;
    real_ip_header proxy_protocol;
    port_in_redirect off; ###重定向去掉端口号
  add_header Strict-Transport-Security max-age=15768000;
  server_name api.bika.life;
  access_log /data/wwwlogs/api.bika.life_nginx.log combined;
  index index.html index.htm index.php;
  root /data/wwwroot/api.bika.life;
    location /picaapi.picacomic.com/ {
        proxy_set_header user-agent "okhttp/3.8.1";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_ssl_name picaapi.picacomic.com;
        proxy_ssl_server_name on;
        proxy_http_version 1.1;
        proxy_connect_timeout    10s;
        proxy_read_timeout       10s;
        proxy_set_header Host picaapi.picacomic.com;

        proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts

        proxy_pass https://picaapi.picacomic.com/;
    }
}

图片反代

server {
  listen 80;
    set_real_ip_from 127.0.0.1;
    real_ip_header proxy_protocol;
    port_in_redirect off; ###重定向去掉端口号
  add_header Strict-Transport-Security max-age=15768000;
  server_name img.bika.life;
  access_log /data/wwwlogs/img.bika.life_nginx.log main;
  index index.html index.htm index.php;
  root /data/wwwroot/img.bika.life;
  proxy_intercept_errors on;
  recursive_error_pages on;
  #error_page 404 /404.html;
  #error_page 502 /502.html;
  proxy_redirect https://storage-b.picacomic.com https://img.bika.life/storage-b.picacomic.com;
  proxy_redirect https://img.picacomic.com https://img.bika.life/img.picacomic.com;
  proxy_redirect https://www.picacomic.com https://img.bika.life/www.picacomic.com;
  proxy_redirect https://storage1.picacomic.com https://img.bika.life/storage1.picacomic.com;

  proxy_redirect http://storage-b.picacomic.com http://img.bika.life/storage-b.picacomic.com;
  proxy_redirect http://img.picacomic.com http://img.bika.life/img.picacomic.com;
  proxy_redirect http://www.picacomic.com http://img.bika.life/www.picacomic.com;
  proxy_redirect http://storage1.picacomic.com http://img.bika.life/storage1.picacomic.com;
     location /storage1.picacomic.com/ {
            proxy_ssl_name storage1.picacomic.com;
        proxy_ssl_server_name on;
            proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header user-agent "okhttp/3.8.1";
        proxy_http_version 1.1;
        proxy_connect_timeout    10s;
        proxy_read_timeout       10s;
        proxy_set_header Host storage1.picacomic.com;
        proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts
        proxy_pass https://storage1.picacomic.com/;
        #proxy_intercept_errors on;
        #error_page 301 302 303 = @error_page_302;
    }

        location @error_page_302 {
                set $saved_redirect_location '$upstream_http_location';
                if ($saved_redirect_location ~ "img.picacomic.com"){
                        set $host_value img.picacomic.com;

                }
                if ($saved_redirect_location ~ "storage1.picacomic.com"){
                        set $host_value storage1.picacomic.com;

                }

                if ($saved_redirect_location ~ "www.picacomic.com"){
                        set $host_value www.picacomic.com;
                }

                if ($saved_redirect_location ~ "storage-b.picacomic.com"){
                        set $host_value storage-b.picacomic.com;
                }
                proxy_set_header Host $host_value;
                proxy_ssl_name $host_value;
                proxy_ssl_server_name on;
                proxy_set_header user-agent "okhttp/3.8.1";
                proxy_pass $saved_redirect_location;
                access_log /data/wwwlogs/img.bika.life_nginx.log combined;
                error_page 301 302 307 = @error_page_302;
        }

     location /img.picacomic.com/ {
        proxy_ssl_name img.picacomic.com;
        proxy_ssl_server_name on;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header user-agent "okhttp/3.8.1";
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_http_version 1.1;
        proxy_connect_timeout    10s;
        proxy_read_timeout       10s;
        proxy_set_header Host img.picacomic.com;
        proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts
        proxy_pass https://img.picacomic.com/;
    }
     location /storage-b.picacomic.com/static/tobs/ {

        proxy_ssl_name storage-b.picacomic.com;
        proxy_ssl_server_name on;
        proxy_set_header user-agent "okhttp/3.8.1";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_http_version 1.1;
        proxy_connect_timeout    10s;
        proxy_read_timeout       10s;
        proxy_set_header Host storage-b.picacomic.com;
        proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts
        proxy_pass https://storage-b.picacomic.com/static/;
        #proxy_intercept_errors on;
        #error_page 301 302 303 = @error_page_302;
    }

     location /storage-b.picacomic.com/ {
        proxy_ssl_name storage-b.picacomic.com;
        proxy_ssl_server_name on;
        proxy_set_header user-agent "okhttp/3.8.1";
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_http_version 1.1;
        proxy_connect_timeout    10s;
        proxy_read_timeout       10s;
        proxy_set_header Host storage-b.picacomic.com;
        proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts
        proxy_pass https://storage-b.picacomic.com/;
        #proxy_intercept_errors on;
        #error_page 301 302 303 = @error_page_302;
    }

     location /www.picacomic.com/ {
        proxy_set_header user-agent "okhttp/3.8.1";
        proxy_ssl_name www.picacomic.com;
        proxy_ssl_server_name on;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_http_version 1.1;
        proxy_connect_timeout    10s;
        proxy_read_timeout       10s;
        proxy_set_header Host www.picacomic.com;
        proxy_hide_header Strict-Transport-Security; #隐藏协议头,避免因为反向代理开启hsts
        proxy_pass https://www.picacomic.com/;
    }
}

配置去掉了https,需要取消勾选https