Skip to content

private: reverse proxy only for certain remote IP's

jpduyx edited this page Feb 18, 2024 · 1 revision

I want to access private.domain.com only from my own (or whitelisted) IP's and deny access for everybody else:

Using .not to deny everything that is not in the list:

labels: 
  caddy private.domain.com
  [email protected]_0: "remote_ip _my_ip_ private_ranges"
  # [email protected]_1: "remote_host _mydynamic.host.name_" # only with the caddy_remote_host plugin!
  caddy.abort: "@denied"
  caddy.reverse_proxy: "{{upstreams}}"

replace my_ip with your ip :-)

Clone this wiki locally