dayeah

nginx反代方法

时间:2021-04-11   阅读:683

[vhosts_cms_zhetaoke.conf]可命令为自己的文件名.替换里面的【demo.zhetaoke.com】改成自己的域名. cms.zhetaoke.com替换为目标站的域名即可实现nginx反代无需用宝塔

方法一:

lInux下CMS(Nginx)安装步骤如下:

1、如果你使用Nginx,打开[Nginx配置说明]目录,拷贝[vhosts_cms_zhetaoke.conf]文件到nginx的conf目录中。

2、打开nginx.conf文件,在最后的一个大括号内写入这段代码(就是引入上面的文件)【include vhosts_cms_zhetaoke.conf;】,注意一定要用分号结束,而且要放在原有的include那一行上面,放在下面会被屏蔽。

3、打开[vhosts_cms_zhetaoke.conf]文件,将【demo.zhetaoke.com】改成你的域名,比如【www.aaa.com】。

server {
    listen 80;
    server_name demo.zhetaoke.com;
    index index.aspx;
	location / {
        proxy_set_header Host cms.zhetaoke.com;
        proxy_set_header X-Real-IP $remote_addr;
		proxy_set_header REMOTE-HOST $remote_addr;
		proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://backend_of_cms.zhetaoke.com__;
        proxy_buffering off;
		proxy_connect_timeout 30;
		proxy_send_timeout 30;
		proxy_read_timeout 30;
		client_max_body_size 1024m;
		client_body_buffer_size 128k;
		proxy_http_version 1.1;
    }
}
upstream backend_of_cms.zhetaoke.com__ {
	server cms.zhetaoke.com:10000;

4、从折淘客官方网站获得CMS的ID号,比如ID编号为20016,那你的cms的访问地址为:http://www.tttyyy.com/?id=20016

5、一定要用【http://www.tttyyy.com/?id=20016】这个地址来推广。

6、配置完成后,可随便点击一个商品,通过查看pid信息来验证是否为自己的链接。


7、nginx.conf文件路径:/www/server/nginx/conf/nginx.conf



CMS高级版ID号获取地址:

http://www.zhetaoke.com/user/extend/extend_cms_site.aspx


上一篇:宝塔面板5.9手动编译php7.3 fileinfo模块

下一篇:腾讯监控 腾讯清凉监控腾讯轻量监控删除

网友评论