最简单的Nginx反代网站教程
如果你是Debian/Ubuntu的话请:
apt-get install nginx
CentOS
yum install nginx
然后,找到你的Nginx配置文件添加虚拟机
server {
listen 80;
server_name u4v.cn;#你的网站
location / {
proxy_set_header Accept-Encoding "";
proxy_pass http://8yf.net/;#你要反代的网站
proxy_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
sub_filter 'u4v.cn' '8yf.net';#替换其中所有的原网站链接
sub_filter_types *;
sub_filter_once off;
}
}
service nginx restart