负载均衡
KEEPALIVED安装与使用
keepalived配置说明
keepalived检测方式
keepalived LVS配置
LVS
LVS-NAT集群的搭建
LVS-DR集群的搭建
KEEPALIVED+LVS
HAproxy
HAProxy配置说明
HAproxy算法
HAProxy管理页
HAProxy保持
HAProxyACL规则
NGINX
NGINX负载均衡
NGINX负载示例二
负载转发路径问题
缓冲缓存参数详解
限制代理ip方法
负载参数详解
nginx_upstream_check_module
正向代理(HTTP)
本文档使用MrDoc发布
返回首页
-
+
NGINX负载示例二
2022年5月6日 17:33
admin
http { log_format main '$remote_addr - $remote_user [$time_local] "$request" ' '$status $body_bytes_sent "$http_referer" ' '"$http_user_agent" "$http_x_forwarded_for" $request_time'; access_log /var/log/nginx/access.log main; sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 4096; include /etc/nginx/mime.types; default_type application/octet-stream; # Load modular configuration files from the /etc/nginx/conf.d directory. # See http://nginx.org/en/docs/ngx_core_module.html#include # for more information. include /etc/nginx/conf.d/*.conf; server { listen 28080 ssl; listen [::]:28080 ssl; server_name _; root /usr/share/nginx/html; # Load configuration files for the default server block. include /etc/nginx/default.d/*.conf; ssl_certificate /etc/nginx/cert/nginx.crt; ssl_certificate_key /etc/nginx/cert/nginx.key; location / { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; proxy_pass http://192.168.88.21; #负载均衡 } #websocket代理 location /tscloud/websocket/ { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_http_version 1.1; proxy_connect_timeout 5s; proxy_read_timeout 60s; proxy_send_timeout 15s; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_buffering off; proxy_pass http://192.168.88.21/tscloud/websocket/; } location /manager/op/security/downFile/Bills { proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_buffering off; proxy_pass http://192.168.88.24/downFile/Bills/; } error_page 404 /404.html; location = /404.html { } error_page 500 502 503 504 /50x.html; location = /50x.html { } } }
分享到: