How do I restore original visitor port with Nginx?


#1

I’m currently restoring the original IP, but I’m having trouble restoring the original port, getting instead the one that cloudflare’s using.
I’m trying to use $realip_remote_port but it doesn’t work

Is it possible? How are you doing it?


#2

Just curious. Why would you even need remote port which is most likely just random (from certain set)?


#4

Turns out the police can’t identify users from mobile networks with just the IP, they need the port too


#5

Bump?


#6

Let me see what info I can dig up on this question. Stay tuned!


#7

@niciusb - we did some digging and don’t believe there is a solution for what you are looking for.


#8

I have the same problem. Police need the port number. IP is not enought. Is any possibilty to add something simmilar to HTTP_CF_CONNECTING_IP like HTTP_CF_CONNECTING_PORT ?