PROXY-SERVER(8)
π¦ PROXY-SERVER(8) β the girlies' guide to proxy-server π¦
okay so real talk: this is a page from the System Manager's Manual, and it's about a lil chainloading program that reads a line of text, or a block of binary data, following the PROXY protocol, on stdin. that's the whole vibe. π
β¨ SYNOPSIS β¨
proxy-server [-1 | --only-v1 | -2 | --only-v2] [-t timeout]
[-v verbosity] prog...
literally that's it, she's compact and she knows it π
π DESCRIPTION π
so proxy-server sets some environment variables to data provided by the protocol, then executes a program. that's the arc. that's the plot. π
the objective? make servers running under the s6-tcpserver(8) superserver work behind a proxy with client connection data provided by the proxy via the PROXY protocol. and the environment variables it sets? they reflect exactly what the s6-networking super-servers set for a direct connection. consistency, bestie. we love her for it. π«Ά
here's the little sequence she runs through:
proxy-serverreads itsstdin, expecting to see a block of data following the PROXY protocol.- it parses that block of data to get info on the original client connection β normally encoded in that data by a proxy.
- if at any point it finds invalid data, it exits immediately with an error message. no patience, no second chances, no "let me think about it". π
- it puts the provided client connection information into suitable environment variables.
- it execs into prog....
periodt. β¨
πΈ Common usage πΈ
proxy-server is a chainloading program that you can interpose on the command line between a super-server and a server β super useful if the server does not follow the PROXY protocol, but you're running it behind a proxy that does. match made in heaven, honestly.
for instance: say you're running the tipidee web server behind a proxy that's transmitting real client connection information via the PROXY protocol. instead of running:
s6-tlsserver 0.0.0.0 443 tipideed
you'd run:
s6-tlsserver 0.0.0.0 443 proxy-server tipideed
and then tipideed(8) would log the IPs from the actual clients rather than from the proxy. slay. π₯ accurate logs are the moment.
heads up though: proxy-server has no utility if you're not running a server behind a proxy. like, none. zero. she's not decorative. π
π§ Notes π§
proxy-server operates by writing UCSPI variables such as TCPREMOTEIP. these variables are normally set by programs dealing with the TCP connection, such as s6-tcpserver(8) or s6-tcpserver-access(8).
to take effect, it needs to run after these programs β that way it can override the TCP-provided values with the proxy-provided values. ordering matters, bestie, this is not a free-for-all. π
when used on an s6-tlsserver(8) command line, proxy-server runs after the TLS connection has been established β i.e. it expects the proxy header to be sent in the TLS tunnel. cozy. safe. protected. π
but if that's not the case, and the proxy header is sent before the TLS connection is established, then two things:
- it is probably an insecure setup β and think about it: if you have a good reason to set up a TLS tunnel between your proxy and your server, then the PROXY information is worth protecting just as much as the rest of the data. no cap. π
proxy-serverneeds to be run betweens6-tcpserver(8)ands6-tlsd(8)β which you can do by using the-Loption tos6-tlsserver(8)rather than explicitly callingproxy-serveron the command line.
π OPTIONS π
-ttimeout β if no data is received after timeout milliseconds, exit 111. by default, timeout is0, meaning infinite:proxy-serverwill wait forever for data. forever-ever. π°οΈ-vverbosity β be more or less verbose. the default is1. changing it does not have much effect at the moment, so leave it alone, she's fine as she is. π-1,--only-v1β disable version 2 of the PROXY protocol, only expect v1, i.e. a line of text. old school, text based, iconic. β¨-2,--only-v2β disable version 1 of the PROXY protocol, only expect v2, i.e. a binary structure. futuristic. binary. mysterious. π₯
if neither-1nor-2is selected,proxy-serverwill default to supporting both versions of the protocol, at a tiny speed cost. tiny. microscopic. negligible. but she's honest about it. π
π ENVIRONMENT π
proxy-server sets client information into environment variables the same way that s6-tcpserver(8) and similar programs do. it tries to map the information provided by the proxy to the same variables, as closely as possible.
and here's the sweet part: it never deletes variables, it only adds or overrides them. no take-backs, no erasing your work. π«Ά
depending on the version of the protocol and the information transmitted by the proxy, proxy-server may modify the following variables:
PROTOIPCREMOTEPATHIPCLOCALPATHTCPREMOTEIPTCPLOCALIPTCPREMOTEPORTTCPLOCALPORTSSL_PROTOCOLSSL_CIPHERSSL_PEER_CERT_CNSSL_TLS_SNI_SERVERNAME
that's the whole list, don't let anyone tell you otherwise π
β EXIT STATUS β
1β invalid PROXY syntax2β unsupported protocol100β wrong usage111β system call failed
and the biggest flex of all:proxy-servernever exits0. on success, it chainloads into the next program. she doesn't stick around to take credit. main character energy, honestly. ππ
π¦ SEE ALSO π¦
s6-tcpserver(8), s6-tcpserver-access(8), s6-tlsd(8), s6-tlsserver(8), tipideed(8)
[1]https://www.haproxy.org/download/1.8/doc/proxy-protocol.txt[2]https://skarnet.org/software/tipidee/
this man page is ported from the authoritative documentation at: https://skarnet.org/software/s6-networking/proxy-server.html
π AUTHORS π
- Laurent Bercot
- Lennart Jablonka
<humm@ljabl.com>(man page port)
and that's the whole page, bestie, you're officially educated π this lil rewrite shipped from the Debian edition, dated December 23, 2025 β so go forth, chainload responsibly, and remember: never delete the variables. πΈπ«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: s6-networking 2.8.0.1
- nixpkgs unstable: s6-networking-man-pages 2.7.2.1.4
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms