nginx反向代理镜像网站做小偷站

我们可以通过Nginx的反向代理,来实现山寨或克隆一个网站。

比做小偷站实现起来更简单,因为不用任何网站程序,只需配置Nginx的反向代理即可。

upstream www_cqclub_com {
	server  115.238.101.200:80;
}
server{
	listen 80;
	server_name www.cqclub.com;
	proxy_set_header Host www.22.cn;
	proxy_set_header x-forwarded-for  $remote_addr;
	location /{
		proxy_pass http://www_cqclub_com;
	}
}

并且可以使用第三方模块HttpSubModule进行关键词替换,可以将对方网站的域名,广告等替换成自己的。

插件地址: http://wiki.nginx.org/HttpSubsModule

location / {
	subs_filter_types text/html text/css text/xml;
    subs_filter st(\d*).example.com $1.example.com ir;
    subs_filter a.example.com s.example.com;
}

当然我们也可以在nginx中开启缓存,这样就不需要每次都向源网站发起请求了。


你可能感兴趣的:(其他技术)