Skip to content

Instantly share code, notes, and snippets.

@gaoyichuan
Created July 9, 2016 15:31
Show Gist options
  • Save gaoyichuan/2a6341d1dc273201f1595fbcbd23e31b to your computer and use it in GitHub Desktop.
Save gaoyichuan/2a6341d1dc273201f1595fbcbd23e31b to your computer and use it in GitHub Desktop.
nginx nmzsks reverse proxy
server {
listen 80;
server_name nmzsks.daoapp.io;
location / {
set $referer $http_referer;
if ($http_referer ~ '^(http://)nmzsks.daoapp.io(/.+)$') {
set $referer $1www1.nm.zsks.cn$2;
}
proxy_pass http://www1.nm.zsks.cn;
proxy_set_header Host "www1.nm.zsks.cn";
proxy_set_header Accept "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
proxy_set_header Accept-Encoding "gzip, deflate";
proxy_set_header Upgrade-Insecure-Requests 1;
proxy_set_header User-Agent $http_user_agent;
proxy_set_header Accept-Language "en,zh-CN;q=0.8,zh;q=0.6,en-US;q=0.4";
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Referer $referer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment