All Collections
Advanced usage
Using a custom domain with Bugfender
Using a custom domain with Bugfender
Jordi Giménez avatar
Written by Jordi Giménez
Updated over a week ago

Our SDK usually contacts our servers at api.bugfender.com (or similar, this might be different if you have a private instance). You might be interested in sending the logs using a custom domain, for example logs.yourcompany.com. This article explains the steps necessary to set this up.

Requirements:

  • A DNS entry on your domain, for example logs.yourcompany.com

  • An SSL certificate for that domain name

  • A proxy that redirects the traffic to api.bugfender.com

Proxying the traffic using a proxy and Let's Encrypt

You can run a small server that does the TLS termination with your domain name and forwards all traffic to our servers. You can do that with your proxy of preference, for example NGINX, Apache, HAProxy or Traefik.

Here is a sample set of configuration files for Traefik with a certificate generated using Let's Encrypt:

traefik.toml:

[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"

[entryPoints.websecure]
address = ":443"

[certificatesResolvers.lets-encrypt.acme]
email = "[email protected]" #TODO: fill in your email address
storage = "ssl/acme.json"
[certificatesResolvers.lets-encrypt.acme.tlsChallenge]

[providers.file]
filename = "traefik_dynamic.toml"

traefik_dynamic.toml:

[http.routers.api]
rule = "Host(`logs.example.com`)" #TODO: fill in your hostname
entrypoints = ["websecure"]
service = "api"
[http.routers.api.tls]
certResolver = "lets-encrypt"

[http.services]
[http.services.api.loadBalancer]
passHostHeader = false
[[http.services.api.loadBalancer.servers]]
url = "https://api.bugfender.com/"

You can run this example with the following command:

docker run -d \
-v $PWD/traefik.toml:/traefik.toml \
-v $PWD/traefik_dynamic.toml:/traefik_dynamic.toml \
-v $PWD/ssl:/ssl \
-p 80:80 -p 443:443 \
traefik:2.4

Did this answer your question?