Browse files

Formatting by hand, chapter 3 and up still not edited

  • Loading branch information...
1 parent dc9cc65 commit 46126c7d4f129fb1023a818862cac2f7a4574a38 @langpavel committed Jan 23, 2012
BIN version-1-5/tex/configuration.pdf
Binary file not shown.
5 version-1-5/tex/configuration.tex
@@ -3,6 +3,8 @@
\usepackage{amsmath,amssymb,amsfonts} % Typical maths resource packages
% \usepackage{graphics} % Packages to allow inclusion of graphics
\usepackage{color} % For creating coloured text and background
@@ -43,9 +45,12 @@
\newcommand{\option}[1]{\texttt{option\nolinebreak[3] #1}}
29 version-1-5/tex/ed_01-03--http-response.tex
@@ -0,0 +1,29 @@
+% Section 1.3.
+\section{HTTP response}
+An HTTP response looks very much like an HTTP request. Both are called HTTP
+messages. Let's consider this HTTP response:
+\label{HTTP response}\begin{listing}{1}
+HTTP/1.1 200 OK
+Content-length: 350
+Content-Type: text/html
+As a special case, HTTP supports so called \emph{Informational responses} as status
+codes 1xx. These messages are special in that they don't convey any part of the
+response, they're just used as sort of a signaling message to ask a client to
+continue to post its request for instance. In the case of a status 100 response
+the requested information will be carried by the next non-100 response message
+following the informational one. This implies that multiple responses may be
+sent to a single request, and that this only works when keep-alive is enabled
+(1xx messages are HTTP/1.1 only). HAProxy handles these messages and is able to
+correctly forward and skip them, and only process the next non-100 response. As
+such, these messages are neither logged nor transformed, unless explicitly
+state otherwise. Status 101 messages indicate that the protocol is changing
+over the same connection and that haproxy must switch to tunnel mode, just as
+if a \httpmethod{CONNECT} had occurred. Then the Upgrade header would contain additional
+information about the type of protocol the connection is switching to.
55 version-1-5/tex/ed_01-03-01--the-response-line.tex
@@ -0,0 +1,55 @@
+% Section 1.3.1.
+\subsection{The Response line}
+Line 1 is the \emph{response line}. It is always composed of 3 fields:
+% - a version tag : HTTP/1.1
+\qquad \= {a \emph{version tag}}\qquad\= \verb|HTTP/1.1| \\
+% - a status code : 200
+\> {a \emph{status code}} \> \verb|200| \\
+% - a reason : OK
+\> {a \emph{reason}} \> \verb|OK|
+The status code is always 3-digit. The first digit indicates a general status:
+\qquad \httpcode{1xx} \qquad \= informational message to be skipped (eg: \httpcode{100}, \httpcode{101}) \\
+\qquad \httpcode{2xx} \> OK, content is following (eg: \httpcode{200}, \httpcode{206}) \\
+\qquad \httpcode{3xx} \> OK, no content following (eg: \httpcode{302}, \httpcode{304}) \\
+\qquad \httpcode{4xx} \> error caused by the client (eg: \httpcode{401}, \httpcode{403}, \httpcode{404}) \\
+\qquad \httpcode{5xx} \> error caused by the server (eg: \httpcode{500}, \httpcode{502}, \httpcode{503}) \\
+Please refer to \RFC{2616} for the detailed meaning of all such codes. The
+\emph{reason} field is just a hint, but is not parsed by clients. Anything can be
+found there, but it's a common practice to respect the well-established
+messages. It can be composed of one or multiple words, such as \httpstatus{OK},
+\httpstatus{Found}, or \httpstatus{Authentication~Required}.
+Haproxy may emit the following status codes by itself:
+\item[Code] When / reason
+\item[\httpcode{200}] access to stats page, and when replying to monitoring requests
+\item[\httpcode{301}] when performing a redirection, depending on the configured code
+\item[\httpcode{302}] when performing a redirection, depending on the configured code
+\item[\httpcode{303}] when performing a redirection, depending on the configured code
+\item[\httpcode{400}] for an invalid or too large request
+\item[\httpcode{401}] when an authentication is required to perform the action
+ (when accessing the stats page)
+\item[\httpcode{403}] when a request is forbidden by a \keyword{block} ACL or \keyword{reqdeny} filter
+\item[\httpcode{408}] when the request timeout strikes before the request is complete
+\item[\httpcode{500}] when haproxy encounters an unrecoverable internal error, such as
+ a memory allocation failure, which should never happen
+\item[\httpcode{502}] when the server returns an empty, invalid or incomplete response, or
+ when an \keyword{rspdeny} filter blocks the response.
+\item[\httpcode{503}] when no server was available to handle the request, or in response to
+ monitoring requests which match the \keyword{monitor fail} condition
+\item[\httpcode{504}] when the response timeout strikes before the server responds
+The error \httpcode{4xx} and \httpcode{5xx} codes above may be customized
+(see \keyword{errorloc} in \autoref{keywords reference}).
10 version-1-5/tex/ed_01-03-02--the-response-headers.tex
@@ -0,0 +1,10 @@
+% Section 1.3.2.
+\subsection{The response headers}
+Response headers work exactly like request headers, and as such, HAProxy uses
+the same parsing function for both. Please refer to paragraph 1.2.2 for more
5 version-1-5/tex/ed_02--configuring-haproxy.tex
@@ -0,0 +1,5 @@
+% Section 2.
+\chapter{Configuring HAProxy}
19 version-1-5/tex/ed_02-01--configuration-file-format.tex
@@ -0,0 +1,19 @@
+% Section 2.1.
+\section{Configuration file format}
+HAProxy's configuration process involves 3 major sources of parameters:
+\item the arguments from the command-line, which always take precedence
+\item the \keyword{global} section, which sets process-wide parameters
+\item the proxies sections which can take form of \keyword{defaults},
+ \keyword{listen}, \keyword{frontend} and \keyword{backend}.
+The configuration file syntax consists in lines beginning with a keyword
+referenced in this manual, optionally followed by one or several parameters
+delimited by spaces. If spaces have to be entered in strings, then they must be
+preceded by a backslash \CHAR{\bslash} to be escaped. Backslashes also have to be
+escaped by doubling them.
20 version-1-5/tex/ed_02-02--time-format.tex
@@ -0,0 +1,20 @@
+% Section 2.2.
+\section{Time format}
+Some parameters involve values representing time, such as timeouts. These
+values are generally expressed in milliseconds (unless explicitly stated
+otherwise) but may be expressed in any other unit by suffixing the unit to the
+numeric value. It is important to consider this because it will not be repeated
+for every keyword. Supported units are:
+\qquad\=\CHAR{us}\quad\= microseconds\quad\= $1\,\mu s = 10^{-6}\,s = \nicefrac{1}{\numprint{1000000}}\,s$\\
+\>\CHAR{ms} \> milliseconds\> $1\,ms = 10^{-3}\,s = \nicefrac{1}{\numprint{1000}}\,s$. \em{This is the default.}\\
+\>\CHAR{s} \> seconds\> $1\,s = \numprint{1000}\,ms$\\
+\>\CHAR{m} \> minutes\> $1\,m = 60\,s = \numprint{60000}\,ms$\\
+\>\CHAR{h} \> hours\> $1\,h = 60\,m = \numprint{3600}\,s = \numprint{3600000}\,ms$\\
+\>\CHAR{d} \> days\> $1\,d = 24\,h = \numprint{1440}\,m = \numprint{86400}\,s = \numprint{86400000}\,ms$\\
48 version-1-5/tex/ed_02-03--examples.tex
@@ -0,0 +1,48 @@
+% Section 2.3.
+# Simple configuration for an HTTP proxy listening on port 80
+# on all interfaces and forwarding requests to a single
+# backend "servers" with a single server "server1"
+# listening on
+ daemon
+ maxconn 256
+ mode http
+ timeout connect 5000ms
+ timeout client 50000ms
+ timeout server 50000ms
+frontend http-in
+ bind *:80
+ default_backend servers
+backend servers
+ server server1 maxconn 32
+# The same configuration defined with a single listen block. Shorter but
+# less expressive, especially in HTTP mode.
+ daemon
+ maxconn 256
+ mode http
+ timeout connect 5000ms
+ timeout client 50000ms
+ timeout server 50000ms
+listen http-in
+ bind *:80
+ server server1 maxconn 32
+Assuming haproxy is in \verb|$PATH|, test these configurations in a shell with:
+ $ sudo haproxy -f configuration.conf -c
5,463 version-1-5/tex/ed_04-02--alphabetically-sorted-keywords-reference.tex
5,463 additions, 0 deletions not shown because the diff is too large. Please use a local Git client to view these changes.
16 version-1-5/tex/ed_chapters.tex
@@ -4,13 +4,13 @@
@@ -19,7 +19,7 @@

0 comments on commit 46126c7

Please sign in to comment.