This expects that your have a cosmos node running on localhost
and opened ports 80
and 443
on your firewall and assigned a domain name to your server's public ip address.
- Download Traefik
https://github.com/containous/traefik/releases
wget https://github.com/containous/traefik/releases/download/v1.6.0/traefik
- Create a traefik config from the example below. Change the domain at #MUSTCHANGE to yours
# Sample entrypoint configuration when using ACME.
[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]
# Enable ACME (Let's Encrypt): automatic SSL.
[acme]
# Email address used for registration.
#
# Required
#
email = "[email protected]"
# File or key used for certificates storage.
#
# Required
storage = "acme.json"
# or `storage = "traefik/acme/account"` if using KV store.
# Entrypoint to proxy acme apply certificates to.
#
# Required
#
entryPoint = "https"
[[acme.domains]]
main = "example.com" #MUSTCHANGE to your domain
[acme.httpChallenge]
entryPoint = "http"
[file]
[backends]
[backends.backend1]
[backends.backend1.servers.cosmos]
url = "http://localhost:46657"
[frontends]
[frontends.cosmos]
backend = "backend1"
entrypoints = ["http","https"]
[frontends.cosmos.routes.hosts]
rule = "Host:example.com" #MUSTCHANGE to your domain
passHostHeader = true
passTLSCert = true
priority = 10
- Start the proxy
sudo ./traefik --configFile=traefik.cosmos.toml
Try
sudo ./traefik --configFile=traefik.cosmos.toml --loglevel=DEBUG
to debug