利用nginx反代可以镜像源站,彻底更换源站中的地址和链接,下面是conf文件中写法:
server {
listen 80;
server_name m.xxxx.com ;
root /home/wwwroot/www.xxxx.com;
index index.html index.htm index.php default.html default.htm default.php;
location / {
subs_filter '47.94.208.99:8106' 'm.xxx.com' ;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Referer http://47.94.208.99:8106;
proxy_set_header Host 47.94.208.99:8106;
proxy_pass http://47.94.208.99:8106;
proxy_set_header Accept-Encoding "";
}
}
相关IP及网址参数自行更改为自己的。