Spaces:
Running
Running
pid /tmp/nginx.pid; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
# 全局超时设置 | |
proxy_connect_timeout 60s; # 连接超时 | |
proxy_read_timeout 60s; # 读取超时 | |
proxy_send_timeout 60s; # 发送超时 | |
server { | |
listen 7860; | |
server_name localhost; | |
location ~ .*\.(json)?$ { | |
proxy_pass https://yande.re; | |
proxy_set_header Host yande.re; | |
proxy_set_header Referer "https://yande.re"; | |
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; | |
#Persistent connection related configuration | |
add_header X-Cache $upstream_cache_status; | |
#Set Nginx Cache | |
proxy_set_header Accept-Encoding ""; | |
sub_filter_types *; | |
#test | |
sub_filter "https://files.yande.re/" "http://rogerxavier-pixiv.hf.space/files/"; | |
sub_filter "https://assets.yande.re/" "http://rogerxavier-pixiv.hf.space/assets/"; | |
#test | |
sub_filter_once off; | |
} | |
location = /index.html { | |
root /etc/nginx/html; # 指定目录而不是文件 | |
default_type text/html; # 设置返回类型为 HTML | |
} | |
location /files{ | |
proxy_pass https://files.yande.re/; | |
proxy_set_header Host files.yande.re; | |
proxy_set_header Referer "https://yande.re"; | |
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; | |
#Persistent connection related configuration | |
add_header X-Cache $upstream_cache_status; | |
#Set Nginx Cache | |
} | |
location /assets{ | |
proxy_pass https://assets.yande.re/; | |
proxy_set_header Host assets.yande.re; | |
proxy_set_header Referer "https://yande.re"; | |
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; | |
#Persistent connection related configuration | |
add_header X-Cache $upstream_cache_status; | |
#Set Nginx Cache | |
} | |
} | |
} | |