티스토리 뷰

HAPROXY 옵션


기본적인 옵션 (아래와 같이 설정하면 무리없이 동작 한다)


global

        log 127.0.0.1   local0

        log 127.0.0.1   local1 notice

        maxconn 4096

        uid 99

        gid 99

        daemon


defaults

        log     global

        mode    http

        option  dontlognull

        retries 3

        maxconn 2000

        contimeout      5000

        clitimeout      50000

        srvtimeout      50000


listen stats :10005

        stats enable

        stats uri     /

        stats hide-version


listen  80 아이피(가상아이피):80

        option httplog

        option forwardfor

        mode http

        balance source

        server test 아이피(웹서버):80 check inter 10000 rise 1 fall 1 



HTTP 헤더에 특정 구문 삽입


http-request set-header X-Custom-Header %[src]:%[dst_port] 


src : 소스아이피

dst_port : 목적지 포트


실제 패킷 덤프

Host: xx.68.xx.8

Connection: keep-alive

Cache-Control: max-age=0

Accept: image/webp,*/*;q=0.8

If-None-Match: "680e8e-396-4f190035f3b40"

If-Modified-Since: Tue, 04 Feb 2014 07:59:01 GMT

User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36

Referer: http://xx.68.xx.8/

Accept-Encoding: gzip,deflate,sdch

Accept-Language: ko-KR,ko;q=0.8,en-US;q=0.6,en;q=0.4

Cookie: PHPSESSID=clgc3ujiholrsmb7s7f8odlli0; mobile=false; user-agent=14ed2ce0721541a00807420602d3a874

X-Custom-Header: xx.68.xx.2:80 (헤더에 삽입된 부분)

X-Forwarded-For: xx.68.xx.2 



자세한 옵션은 아래의 문서를 참고



http://haproxy.1wt.eu/download/1.5/doc/configuration.txt 


http://blog.haproxy.com/





댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/04   »
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
글 보관함