#教程#最简单的Nginx反代网站教程
主机社 1月前

最简单的Nginx反代网站教程

如果你是Debian/Ubuntu的话请:

apt-get install nginx

CentOS

yum install nginx

然后,找到你的Nginx配置文件添加虚拟机

server    {        listen          80;        server_name     bsc.com;#你的网站        location / {                proxy_set_header Accept-Encoding "";                proxy_pass             http://abc.com/;#你要反代的网站                proxy_redirect          off;                proxy_set_header        X-Real-IP       $remote_addr;                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;                sub_filter  'bsc.com' 'abc.com';#替换其中所有的原网站链接                sub_filter_types *;                sub_filter_once off;        }    }
 service nginx restart

最新回复 (0)
返回
网站标签