Advertisement
Tsukigase

Nginx本地反代pixiv设定档

Jun 18th, 2022 (edited)
967
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 0.75 KB | None | 0 0
  1. proxy_cache_path /setu/cache levels=1:2 keys_zone=pximg:10m max_size=1g inactive=1d use_temp_path=off;
  2.  
  3. server {
  4.     listen 80;
  5.     server_name localhost;
  6.     access_log off;
  7.     location / {
  8.         proxy_cache pximg;
  9.         proxy_pass https://i.pximg.net;
  10.         proxy_cache_revalidate on;
  11.         proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
  12.         proxy_cache_lock on;
  13.         add_header X-Cache-Status $upstream_cache_status;
  14.         proxy_set_header Host i.pximg.net;
  15.         proxy_set_header Referer "https://www.pixiv.net/";
  16.         proxy_set_header User-Agent "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 YaBrowser/23.0.0.00.00 SA/3 Safari/537.36";
  17.         proxy_cache_valid 200 7d;
  18.         proxy_cache_valid 404 5m;
  19.     }
  20. }
  21.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement