Whitelist IP address using VPN

Hello Caddiers (or just Caddy users),

I am trying to whitelist my VPN server for accessing certain restricted paths. The problem is that Caddy is seeing my real IP in the field “remote_addr” (from the logs).

Every other test page is returning me the VPN server IP Address.
How is that possible? What am I missing or doing wrong?


I forgot to mention a very important detail:
VPN server and webserver are under the same IP address.

I guess VPN client might not be using the VPN link for these requests, hence the reason why I see my real IP.

Anyone experienced the same situation? If we can confirm this, then it won’t be a Caddy specific question but networking.


This is 100% a networking problem.

Caddy is just reporting what information it has about the incoming connection. If the VPN were working for that address, there’s no way it would unwrap that and determine your real IP. This is all effectively decided well before you connect and talk to Caddy.

Thank you @Whitestrake
Just confirmed that if the VPN server has the same IP as the server that is serving the webpage, my request will directly go to the server without being tunneled through the VPN.

I might delete this post as it is not related to Caddy.


This topic was automatically closed after 90 days. New replies are no longer allowed.