I am using OpenResty (Nginx 1.25.3) to proxy FTP traffic (as TCP stream) to the correct server according to the target host (subdomain) set by the FTP client. With proxy_protocol this should be possible by using the $proxy_protocol_tlv_authority nginx variable. But unfortunately, the variable is not set when the requests hit my OpenResty gateway.
I logged the proxy_protocol nginx variables with a test request sent with filezilla:
ngx.var.proxy_protocol_tlv_alpn: nil
ngx.var.proxy_protocol_tlv_authority: nil
ngx.var.proxy_protocol_tlv_unique_id: nil
ngx.var.proxy_protocol_tlv_netns: nil
ngx.var.proxy_protocol_server_addr: xxxx:xxxx:x::xx:xxxx
ngx.var.proxy_protocol_server_port: 2121
ngx.var.proxy_protocol_addr: xxxx:xx:xxxx:xxxx::xxx
ngx.var.proxy_protocol_port: 59276
# fly.toml for the OpenResty gateway
[build]
image = "openresty/openresty:bullseye-fat"
[http_service]
internal_port = 80
force_https = true
min_machines_running = 1
# FTP active mode port
[[services]]
internal_port = 2121
protocol = "tcp"
[[services.ports]]
port = 2121
handlers = ["proxy_proto"]
I also tried with proxy_proto_options = { version = "v2" }
but with no different outcome.
It looks like the TLVs are missing or not forwarded, but as I read in other threads in here, they should be… Am I misconfiguring something here?