https://github.com/dedok/nginx-stream-proxy-protocol-v2
The patch for NGINX.Streams which brings support of proxy protocol v2
https://github.com/dedok/nginx-stream-proxy-protocol-v2
nginx patch proxy-protocol stream v2
Last synced: 2 months ago
JSON representation
The patch for NGINX.Streams which brings support of proxy protocol v2
- Host: GitHub
- URL: https://github.com/dedok/nginx-stream-proxy-protocol-v2
- Owner: dedok
- License: bsd-2-clause
- Created: 2021-03-16T12:29:31.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2022-08-12T07:44:33.000Z (over 3 years ago)
- Last Synced: 2023-03-27T11:21:05.595Z (about 3 years ago)
- Topics: nginx, patch, proxy-protocol, stream, v2
- Language: C
- Homepage:
- Size: 73.2 KB
- Stars: 11
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NGINX.Stream / Proxy Protocol v2
The patch for NGINX.Streams which brings support of proxy protocol v2.
For getting information about configuration please see `Configuration`.
The implementataion is based on `2.2.Binary header format (version 2)` from the
document [1].
Also if you need to extend the proxy protocol reading please see this project [2].
```
[1] http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt
[2] https://github.com/slact/nginx_proxy_protocol_tlv_vars
```
# Current status
1. It tested only on Linux, Mac (OSX).
This patch would not work compile under Windows platform, because codes are using some GCC attributes.
3. I'm happy to get any feedback about TLV features. Please create a ticket, if you wish to see more TLV features.
## Current TLVs features:
1. SSL: version, cn, cert conn, cipher, key alg, sig alg.
# Plans
The plan is: I would like to add this patch to the official NGINX.Stream in the future.
Please see this ticket for getting more details: https://trac.nginx.org/nginx/ticket/1639
# Configuration
**syntax:** *proxy_protocol on|off|v2*
1. on and off working as described in the official documentataion [1]
2. v2 sets sending proxy protocol v2 line to the backend.
```
[1] http://nginx.org/en/docs/stream/ngx_stream_proxy_module.html#proxy_protocol
```
# How to build
1. Choose the version of the NGINX (ex: stream-proxy-protocol-v2-release-1.19.8.patch)
2. Apply the patch:
```bash
$> cd NGINX-SOURCES-ROOT
$> patch -p1 < stream-proxy-protocol-v2-release-1.19.8.patch
# Compile NGINX
```
# Docker
WARNING:
nginx would be built for debug purposes and with debug options,
be careful do not use this image's settings for the production.
1. Change upstreams in the nginx.conf file
2. Execute:
```bash
$> docker build -t nginx-proxy-protocol-v2 .
$> docker run -i -t nginx-proxy-protocol-v2 bash
```