VanLiuZhi commented on issue #10626:
URL: https://github.com/apache/apisix/issues/10626#issuecomment-1859620547
I also encountered the same problem. Nginx forwards to apisix at the 4th
layer. I have already configured the proxy protocol in nginx, and apisix should
also be configured to support the proxy protocol. Generally, we want to read
the real IP of the client. But I don't understand how to configure the proxy
protocol in apisix. I found the following configuration:
#proxy_protocol: # Proxy Protocol configuration
# listen_http_port: 9181 # The port with proxy protocol for http,
it differs from node_listen and admin_listen.
# This port can only receive http request with proxy protocol, but
node_listen & admin_listen
# can only receive http request. If you enable proxy protocol, you must use
this port to
# receive http request with proxy protocol
# listen_https_port: 9182 # The port with proxy protocol for https
# enable_tcp_pp: true # Enable the proxy protocol for tcp proxy,
it works for stream_proxy.tcp option
# enable_tcp_pp_to_upstream: true # Enables the proxy protocol to the
upstream server
I tried to verify and found that listen_http_port must be configured. At
this time, my apisix listens on port 80, so listen_http_port cannot be
configured as port 80. Do I have to separate the data with proxy protocol from
the data without proxy protocol?
From the comments in the configuration, can I only modify the listen, for
example, change it to 8020, and then use listen_http_port as the entrance for
all my traffic, which means the listen port is abandoned because I don't need
to separate the data with proxy protocol from the data without proxy protocol.
proxy_protocol:
listen_http_port: 80
listen_https_port: 443
enable_tcp_pp_to_upstream: true
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]