Skip to content

Configurations

yusing edited this page Jan 31, 2025 · 23 revisions

Configurations

Basic Config File

Here's a simple example of a configuration file:

providers:
  docker:
    local: $DOCKER_HOST

Understanding the Config File

The config.yml file is divided into several sections:

  • autocert: Handles SSL certificate settings. Optional.
  • entrypoint: Manages GoDoxy entrypoints (port 80 and 443). Optional.
    • middlewares: Defines middleware settings. Optional.
    • access_log: Configures access logs. Optional.
  • providers: Sets up orchestrators. This is required.
    • include: Includes static route configuration files. Optional.
    • docker: Configures Docker providers. Optional.
    • notification: Configures notifications for health monitoring. Optional.
  • match_domains: List of domains to match. Optional.
  • homepage: Configures homepage settings. Optional.

SSL Certificate (autocert)

For SSL certificates, you can either use an existing one or set up automatic certificates.

Using an Existing SSL Certificate

autocert:
  provider: local
  # path relative to /app
  cert_path: certs/cert.crt
  key_path: certs/priv.key

Automatic SSL with Cloudflare

autocert:
  provider: cloudflare
  email: [email protected]
  domains:
    - "*.yourdomain.com"
  options:
    auth_token: your-zone-api-token

Cloudflare autocert

Automatic SSL with other DNS providers

Check on WebUI or Supported-DNS‐01-Providers

Troubleshooting SSL Issues

If you encounter issues, try these steps:

  • Set LEGO_DISABLE_CNAME_SUPPORT=1 if your domain has a CNAME record.

  • Use a different DNS server.

    services:
      app:
        container_name: godoxy
        ...
        environment:
          - LEGO_DISABLE_CNAME_SUPPORT=1
        dns:
          - 1.1.1.1
          - 1.1.1.2

Entrypoint Configuration

This section defines how your application handles incoming requests.

entrypoint:
  middlewares:
    - use: CIDRWhitelist
      allow:
        - "127.0.0.1"
        - "10.0.0.0/8"
        - "192.168.0.0/16"
      status: 403
      message: "Forbidden"

  access_log:
    format: combined
    path: /app/logs/access.json.log
    filters: ...
    fields: ...

Setting Up Providers

This part defines how your application should interact with other services.

  • include: Includes static route configuration files. Optional.
  • docker: Configures Docker providers. Optional.
  • notification: Configures notifications for health monitoring. Optional.
providers:
  include:
    - file1.yml
    - file2.yml

  docker:
    local: $DOCKER_HOST
    remote-1: tcp://10.0.2.1:2375
    remote-2: ssh://root:[email protected]

  notification:
    - name: gotify
      provider: gotify
      url: https://gotify.example.com
      token: your-token

Providers

Domain Matching

Specify which domains your application should respond to.

match_domains:
  - yourdomain.com
  - subdomain.yourapp.com

See also: Certificates and domain matching

Homepage Settings

Configure how GoDoxy handles the WebUI App dashboard.

homepage:
  use_default_categories: true

Multi Docker Nodes Setup

To set up multiple Docker nodes, run the following docker compose file on the other node:

docker-proxy:
  container_name: docker-proxy
  image: tecnativa/docker-socket-proxy
  privileged: true
  environment:
    - ALLOW_START=1
    - ALLOW_STOP=1
    - ALLOW_RESTARTS=1
  volumes:
    - /var/run/docker.sock:/var/run/docker.sock
  restart: always
  ports:
    - <ip>:2375:2375

Add this to your config.yml under providers.docker:

providers:
  docker:
    server-1: tcp://<ip>:2375

Example Configurations

Simple Example

example:
  scheme: https
  port: 8989

Advanced Example

Like in docker compose, you can use x-properties in include files

x-proxy: &proxy # ignored
  scheme: https
  middlewares:
    hideXForwarded:
    modifyRequest:
      setHeaders:
        Host: $req_host

api.example.com:
  <<: *proxy # inherit from proxy
  host: api.example.com

Full Example

example: # matching `example.y.z`
  scheme: http
  host: 10.0.0.254
  port: 80
  path_patterns: # Check https://pkg.go.dev/net/http#hdr-Patterns-ServeMux for syntax
    - GET / # accept any GET request
    - POST /auth # for /auth and /auth/* accept only POST
    - GET /home/{$} # for exactly /home
  healthcheck:
    disabled: false
    path: /
    interval: 5s
  load_balance:
    link: app
    mode: ip_hash
    options:
      header: X-Forwarded-For
  middlewares:
    cidr_whitelist:
      allow:
        - 127.0.0.1
        - 10.0.0.0/8
      status_code: 403
      message: IP not allowed
    hideXForwarded:
  homepage:
    name: Example App
    icon: png/example.png
    description: An example app
    category: example
  access_log:
    buffer_size: 100
    path: /var/log/example.log
    filters:
      status_codes:
        values:
          - 200-299
          - 101
      method:
        values:
          - GET
      host:
        values:
          - example.y.z
      headers:
        negative: true
        values:
          - foo=bar
          - baz
      cidr:
        values:
          - 192.168.10.0/24
    fields:
      headers:
        default: keep
        config:
          foo: redact
      query:
        default: drop
        config:
          foo: keep
      cookies:
        default: redact
        config:
          foo: keep

🔼Back to top

Clone this wiki locally