反向代理配置:
1 2 3 4 5 6 7 8 9 10 11 12 |
server { listen 80; server_name mirrors.maqian.work; location / { proxy_pass http://mirrors.aliyun.com; proxy_redirect off; proxy_set_header Host $proxy_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } |
在浏览器访问mirrors.maqian.work
时:
$host
: mirrors.maqian.work$proxy_host
: mirrors.aliyun.com
评论