Skip to content

Instantly share code, notes, and snippets.

@JimLiu
Created August 24, 2018 16:05
Show Gist options
  • Save JimLiu/f92d06eddce99dc3cf0d9293e615d6ea to your computer and use it in GitHub Desktop.
Save JimLiu/f92d06eddce99dc3cf0d9293e615d6ea to your computer and use it in GitHub Desktop.
reverse proxy for 163 music
# Cahce
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=STATIC:10m inactive=24h max_size=1g;
server {
listen 80;
server_name music.163.com;
resolver 114.114.114.114 223.5.5.5;
access_log /var/log/nginx/access_163.log;
location /weapi/feedback/weblog {
add_header Set-Cookie "os=uwp; path=/";
error_page 405 = $uri;
alias /usr/share/nginx/html/163-uwp.json;
}
location / {
proxy_pass http://music.163.com/;
proxy_connect_timeout 6s;
proxy_send_timeout 6s;
proxy_read_timeout 6s;
proxy_set_header Host $host;
proxy_set_header X-Real-IP "59.53.2.192";
proxy_set_header Accept-Encoding "";
proxy_cache STATIC;
proxy_cache_valid 200 1d;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment