服务器代理pixiv图片地址Nginx配置
in 服务器 with 0 comment

服务器代理pixiv图片地址Nginx配置

in 服务器 with 0 comment
proxy_cache_path /path/to/cache levels=1:2 keys_zone=pximg:10m max_size=10g inactive=7d use_temp_path=off;

server {
    listen 443;

    ssl_certificate /usr/local/nginx/conf/cert/pixiv/1_pixiv.visionki.com_bundle.crt;
    ssl_certificate_key /usr/local/nginx/conf/cert/pixiv/2_pixiv.visionki.com.key;

    server_name pixiv.visionki.com;
    access_log off;

    location / {
    proxy_cache pximg;
    proxy_pass https://i.pximg.net;
    proxy_cache_revalidate on;
    proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
    proxy_cache_lock on;
    add_header X-Cache-Status $upstream_cache_status;
    proxy_set_header Host i.pximg.net;
    proxy_set_header Referer "https://www.pixiv.net/";
    proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36";

    proxy_cache_valid 200 7d;
    proxy_cache_valid 404 5m;
 }
}
Responses