Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for accepting the Proxy Protocol #1487

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jkbys
Copy link

@jkbys jkbys commented Aug 9, 2020

If set env as below:

ACCEPT_PROXY_PROTOCOL=true

"proxy_protocol" parameters are added to all listen directives in defaults.conf like as below:

listen 80 proxy_protocol;
listen 443 ssl http2 proxy_protocol;

Additinally, if set env as bellow:

ACCEPT_PROXY_PROTOCOL=true
SET_REAL_IP_FROM=172.16.0.0/12,192.168.0.0/16

"set_real_ip_from" and "real_ip_header" directives are added like as below:

set_real_ip_from 172.16.0.0/12;
set_real_ip_from 192.168.0.0/16;
real_ip_header proxy_protocol;

These lines are added to above of "log_format vhost" line, so the client IP address received from the proxy protocol is logged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant