在IIS上的不同端口实现nginx负载均衡,但访问一直是nginx默认页面 50
#usernobody;worker_processes1;#error_loglogs/error.log;http{includemime.types;default...
#user nobody;
worker_processes 1;
#error_log logs/error.log;
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream 10.199.4.254 {
#ip_hash;
server 10.199.4.254:8081 weight=10 max_fails=20 fail_timeout=2;
server 10.199.4.254:8082 weight=9 max_fails=2 fail_timeout=2;
server 10.199.4.254:8080 backup;
}
server {
listen 80;
server_name 10.199.4.254;
add_header Set-Cookie "HttpOnly=true";
add_header x_via $server_addr;
location ~ ^/NginxStatus/ {
stub_status on; #Nginx 状态监控配置
access_log off;
}
location / {
proxy_redirect off;
proxy_pass http://10.199.4.254;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} 展开
worker_processes 1;
#error_log logs/error.log;
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
upstream 10.199.4.254 {
#ip_hash;
server 10.199.4.254:8081 weight=10 max_fails=20 fail_timeout=2;
server 10.199.4.254:8082 weight=9 max_fails=2 fail_timeout=2;
server 10.199.4.254:8080 backup;
}
server {
listen 80;
server_name 10.199.4.254;
add_header Set-Cookie "HttpOnly=true";
add_header x_via $server_addr;
location ~ ^/NginxStatus/ {
stub_status on; #Nginx 状态监控配置
access_log off;
}
location / {
proxy_redirect off;
proxy_pass http://10.199.4.254;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} 展开
1个回答
2019-08-29
展开全部
同一台服务器开多个端口并不会提高负载能力,纯属脱裤子放屁。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
Storm代理
2023-08-29 广告
2023-08-29 广告
"StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,I...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |