亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費注冊 查看新帖 |

Chinaunix

  平臺 論壇 博客 文庫
最近訪問板塊 發(fā)新帖
查看: 4742 | 回復(fù): 5
打印 上一主題 下一主題

[Web] haproxy1.4.22請求頭http1.1響應(yīng)頭http1.0 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報告]
發(fā)表于 2012-10-24 14:59 |只看該作者 |倒序瀏覽
本帖最后由 stormcc 于 2012-10-24 15:04 編輯

近來折騰haproxy,測試中發(fā)現(xiàn)我使用IE和curl發(fā)送請求頭中為http1.1,但是haproxy的響應(yīng)頭是http1.0。
后來嘗試1.4.22,1.4.21,1.4.19都相同效果!驹鴩L試在listen配置塊添加:no option httpclose指令仍然不行!
不知道大家有沒有遇到過這狀況,怎么解決的。
如下:
# curl http://10.10.77.67/car/120/32/65/Img1646532_120.jpg -H host:m2.auto.it.cn  -o /dev/null -v
* About to connect() to 10.10.77.67 port 80 (#0)
*   Trying 10.10.77.67... connected
* Connected to 10.10.77.67 (10.10.77.67) port 80 (#0)
> GET /car/120/32/65/Img1646532_120.jpg HTTP/1.1
> User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.13.1.0 zlib/1.2.3 libidn/1.18 libssh2/1.2.2
> Accept: */*
> host:m2.auto.it.cn
>
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0* HTTP 1.0, assume close after body
< HTTP/1.0 200 OK
< Server: nginx/0.8.55
< Date: Thu, 18 Oct 2012 09:04:20 GMT
< Content-Type: image/jpeg
< Content-Length: 4634
< Last-Modified: Wed, 25 Jul 2012 02:35:21 GMT
< Expires: Sun, 16 Oct 2022 09:04:20 GMT
< Cache-Control: max-age=315360000
< Accept-Ranges: bytes
< Age: 67409
< X-Cache: HIT from 106_213.auto.it.cn
< Via: 1.1 106_213.auto.it.cn:81 (squid/2.7.STABLE9)
< Connection: close
<
{ [data not shown]
100  4634  100  4634    0     0  1216k      0 --:--:-- --:--:-- --:--:-- 4525k* Closing connection #0

論壇徽章:
0
2 [報告]
發(fā)表于 2012-10-24 15:01 |只看該作者
詳細配置文件如下:
# grep -v ^'#' haproxy.cfg                  
global
    log    127.0.0.1 local3 info
    maxconn     8000
    ulimit-n 16014
    user  haproxy
    group haproxy
    chroot    /opt/haproxy1.4.22/
    pidfile /opt/haproxy1.4.22/logs/haproxy.pid
    nbproc 1   
    daemon

defaults
    mode http
    log global
    option httplog
    timeout connect 10s
    timeout client  10s
    timeout server  10s
    timeout check   2s

listen .auto.it.cn
    bind *:80
    log global
    option httplog
    monitor-net 192.168.106.0/24
    monitor-uri /haproxy.test
    balance   uri
    log    127.0.0.1 local0 debug
    hash-type consistent  
    server cache2 192.168.106.109:81 check inter 1500 rise 3 fall 3 weight 12
    server cache3 192.168.106.213:81 check inter 1500 rise 3 fall 3 weight 12
    http-check send-state
    fullconn 6000
    retries    3
    option redispatch
    option httpchk GET /flag.txt  HTTP/1.0\nHost:\ m1.auto.it.cn
    http-check expect status 200

listen haproxystat
    bind  *:6501
    stats enable
    stats uri   /haproxy-stats  
    stats realm Haproxy/Statistics
    stats auth  admin:admin
    stats hide-version

論壇徽章:
0
3 [報告]
發(fā)表于 2012-10-24 16:21 |只看該作者
----剛剛找到問題原因了

我的haproxy后端是squid,抓包發(fā)現(xiàn)squid請求其后端的nginx源服務(wù)器是http1.0的頭,從而其后端返回給squid的響應(yīng)頭也是http1.0。squid將該http1.0的響應(yīng)返回給了haproxy,haproxy將響應(yīng)頭為http1.0的結(jié)果響應(yīng)給客戶端。

將squid去掉,haproxy后端直連nginx后,haproxy發(fā)送給nginx http1.1的頭,同時接收到nginx1.1的響應(yīng)頭,然后將http1.1的響應(yīng)返回給客戶端。。

是測試中使用的squid沒支持http1.1導(dǎo)致的。

論壇徽章:
0
4 [報告]
發(fā)表于 2012-10-30 15:55 |只看該作者
學(xué)習(xí)了~~一樣的架構(gòu)

論壇徽章:
0
5 [報告]
發(fā)表于 2012-10-30 15:56 |只看該作者
樓主有沒有出現(xiàn)squid經(jīng)常down的情況?

論壇徽章:
0
6 [報告]
發(fā)表于 2012-11-02 09:39 |只看該作者
qqsosoad 發(fā)表于 2012-10-30 15:56
樓主有沒有出現(xiàn)squid經(jīng)常down的情況?


我一直用squid2.7stable9(很老),咱沒有發(fā)現(xiàn)掛掉,只遇到過 squid -k shutdown 關(guān)閉不成功情況。
你的是什么版本?
您需要登錄后才可以回帖 登錄 | 注冊

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報專區(qū)
中國互聯(lián)網(wǎng)協(xié)會會員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP