Nginx负载均衡配置
程序员文章站
2022-04-15 20:12:28
Nginx负载均衡配置项目gateway 在服务器2.10和2.11上nginx 默认是轮询的 weight=1 是权重分配 都是1表示平均分配upstream proejct1 { server 192.168.2.10:12000 weight=1; server 192.168.2.11:12000 weight=1; } server { listen 80; listen [::]:80...
Nginx负载均衡配置
项目gateway 在服务器2.10和2.11上
nginx 默认是轮询的 weight=1 是权重分配 都是1表示平均分配
upstream proejct1 {
server 192.168.2.10:12000 weight=1;
server 192.168.2.11:12000 weight=1;
}
server {
listen 80;
listen [::]:80;
server_name _;
autoindex on;
client_max_body_size 200m;
access_log /var/log/nginx/error.log main;
# Load configuration files for the default server block.
include /etc/nginx/default.d/*.conf;
location / {
root /data/runtime/proejct1/www;
index index.html;
}
location ~* ^/(api) {
proxy_pass http://proejct1;
proxy_set_header Host $host;
proxy_connect_timeout 15s;
proxy_send_timeout 15s;
proxy_read_timeout 15s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
error_page 404 /404.html;
location = /40x.html {
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
}
}
本文地址:https://blog.csdn.net/qq_36567996/article/details/107340865
上一篇: Dubbo源码解析之TPS控制
推荐阅读
-
nginx配置多目录访问-之phalcon如何配置
-
nginx虚拟主机别名配置
-
Nginx + Tomcat + Redis负载均衡及session共享
-
linux中查看nginx、apache、php、mysql配置文件路径实例
-
linux查看nginx、apache、php、php-fpm、mysql及配置项所在目录
-
nginx proxy_cache配置说明 nginx proxy cache nginx tcp proxy nginx proxy pass配
-
centos下nginx+tomcat安装配置 nginx结合tomcat
-
nginx 和php上传附件大小的配置文件修改方法实例
-
nginx停的重定向配置
-
SpringCloud客户端的负载均衡Ribbon的实现