Skip to content

Instantly share code, notes, and snippets.

@Martinligabue
Last active July 5, 2024 10:15
Show Gist options
  • Select an option

  • Save Martinligabue/83500b0d4f3ecb1aab63fb74e4987acc to your computer and use it in GitHub Desktop.

Select an option

Save Martinligabue/83500b0d4f3ecb1aab63fb74e4987acc to your computer and use it in GitHub Desktop.
this Caddy config file can be used if you have already a server (ie. nextcloud) exposed to the internet, and you want a second server (ie. a webserver) to exit with the same ip. they are filtered based on the url used to connect to the ip
# Main domain and all subdomains, proxying to the other server in the local network
<url>, *.<url> {
reverse_proxy https://192.168.1.<ip> {
header_up Host {host}
header_up X-Real-IP {remote}
transport http {
tls_insecure_skip_verify
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment