Skip to content

Instantly share code, notes, and snippets.

@austonpramodh
Created July 12, 2021 14:32
Show Gist options
  • Select an option

  • Save austonpramodh/41c272693f5594751150e7a89c8aeaf9 to your computer and use it in GitHub Desktop.

Select an option

Save austonpramodh/41c272693f5594751150e7a89c8aeaf9 to your computer and use it in GitHub Desktop.
Caddyfile for portainer and pgadmin4
{
# Global options block. Entirely optional, https is on by default
# Optional email key for lets encrypt
email [email protected]
# Optional staging lets encrypt for testing. Comment out for production.
# acme_ca https://acme-staging-v02.api.letsencrypt.org/directory
}
:80 {
handle /portainer* {
redir /portainer /portainer/ permanent
uri strip_prefix /portainer
reverse_proxy portainer:9000
}
handle /pgadmin4* {
redir /pgadmin4 /pgadmin4/ permanent
reverse_proxy pgadmin4:80 {
# pgadmin required this
header_up X-Scheme {scheme}
header_up X-Script-Name "/pgadmin4"
header_up X-Real-IP {remote}
header_up X-Forwarded-Proto {scheme}
}
}
handle {
respond "Hi There, Voila it works!!"
}
}
@MkLHX
Copy link

MkLHX commented Oct 11, 2022

Hi there!
This gist is really great for pgadmin reverse_proxy.

do not miss to add header_up Redirect off on the reverse_proxy directive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment