首页 > 编程知识 正文

内外网网关冲突如何解决,两台服务器做负载均衡

时间:2023-05-03 11:06:34 阅读:126590 作者:4809

1 .创建万维网(/home /万维网)

创建另一个wwwroot/test/index.html (站点目录)

创建vhost文件(/usr/local/nginx/conf/vhost )

配置和加入nginx.conf:include vhost/*.conf;

http{ …… .

include vhost/*.conf; //注意这里放在http{}里而不是外面

}

服务器{

listen80

server _ name test.zhouzhongjie.com;

根/家庭/万维网/测试;

index index.htmlindex.htm index.PHP;

#自动索引on;

}

fastcgi_index index.php;

fastcgi _ param script _ filename $ document _ root $ fastcgi _ script _ name;

包括fastcgi _ params;

}

}

server_name :下划线、域名、ip和localhost

server_name: _

server_name: xxx.com

服务器_ name : 22.22.22.22

server_name:localhost //

服务器

{

listen8001; #listen [:]:80;

server_name localhost;

index index.htmlindex.htm index.PHP default.html default.htm default.PHP;

根/home/wwwrooot/test; #include other.conf;

#error_page 404 /404.html;

# denyaccesstophpfilesinspecificdirectory

# location~/(WP-content ) uploads (/. *.PHP $ { deny all; }

#include enable-php.conf;

{

expires 30d;

}

{

expires 12h;

}

全部全部全部;

}

丹尼阿尔尔;

}

访问_ log off;

}

更改配置文件后,需要重新加载

./nginx-s重新加载

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。