Skip to content

Reverse Proxy Configurations

These configurations are community-provided and might need to be adapted to your specific setup.

HAProxy

Assumes HAProxy is part of your KitchenOwl Docker Compose stack, and you use the multiservice setup method.

global
  log stdout local0

defaults
  mode http
  log global
  option httplog
  option forwardfor if-none
  retries                 3
  timeout http-request    10s
  timeout queue           1m
  timeout connect         10s
  timeout client          1m
  timeout server          1m
  timeout http-keep-alive 10s
  timeout check           10s
  default-server init-addr last,libc,none

resolvers docker
  parse-resolv-conf

#-----------------------#
#  http
#-----------------------#
frontend efeu-http
  bind :::80 v4v6
  bind :::443 v4v6 ssl crt /etc/letsencrypt/live/domain/domain.pem

  redirect scheme https if !{ ssl_fc }

  # hsts max-age is mandatory
  # 16000000 seconds is a bit more than 6 months
  http-response set-header Strict-Transport-Security "max-age=16000000; includeSubDomains; preload;"

  default_backend kitchenowl

backend kitchenowl
  server kitchenowl front:8080 resolvers docker

Traefik v2

This example configuration assumes that you are:

  • Running Traefik on the web Docker network
  • Using the entrypoint websecure for HTTPS with a wildcard SSL certificate
  • Using a security@docker middleware (see below)
services:
  front:
    image: tombursch/kitchenowl-web:latest
    networks:
      - default
      - web
    restart: unless-stopped
    depends_on:
      - back
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=web"
      - "traefik.http.routers.kitchenowl.rule=Host(`your.domain.here`)"
      - "traefik.http.routers.kitchenowl.entrypoints=websecure"
      - "traefik.http.routers.kitchenowl.middlewares=security@docker" # Use to apply security middlewares

  back:
    image: tombursch/kitchenowl-backend:latest
    networks:
      - default
    restart: unless-stopped
    environment:
      FRONT_URL: https://your.domain.here
      JWT_SECRET_KEY: PLEASE_CHANGE_ME
    volumes:
      - kitchenowl_data:/data

networks:
  web:
    external: true

volumes:
  kitchenowl_data:

Traefik can add extra security headers to add a level of protection to your KitchenOwl instance. You can specify a middleware in your Traefik docker-compose.yml using labels:

labels:
  - "traefik.http.middlewares.security.headers.addvaryheader=true"
  - "traefik.http.middlewares.security.headers.sslredirect=true"
  - "traefik.http.middlewares.security.headers.browserxssfilter=true"
  - "traefik.http.middlewares.security.headers.contenttypenosniff=true"
  - "traefik.http.middlewares.security.headers.forcestsheader=true"
  - "traefik.http.middlewares.security.headers.stsincludesubdomains=true"
  - "traefik.http.middlewares.security.headers.stspreload=true"
  - "traefik.http.middlewares.security.headers.stsseconds=63072000"
  - "traefik.http.middlewares.security.headers.customframeoptionsvalue=SAMEORIGIN"
  - "traefik.http.middlewares.security.headers.referrerpolicy=same-origin"

Traefik Ingress (Kubernetes)

This example configuration assumes that:

  • You are running KitchenOwl in a Kubernetes environment where Traefik is your ingress controller
  • You have set up Traefik CRDs according to the Traefik Kubernetes CRD docs (using IngressRoute instead of Kubernetes-native Ingress)
  • KitchenOwl is deployed using a service named kitchenowl-web in the default namespace
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
  name: kitchenowl-ingressroute

spec:
  entryPoints:
    - websecure
  routes:
    - match: Host(`<your.domain.here>`)
      middlewares:
        - name: kitchenowl
      kind: Rule
      services:
        - name: kitchenowl-web
          port: 8080

  tls:
    certResolver: default-tls
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
  name: kitchenowl
spec:
  headers:
    customRequestHeaders:
      X-Forwarded-Proto: "https"
      # enable websockets
      Upgrade: "websocket"

In this setup a new middleware is added to enable WebSocket support on this ingress since it is not enabled by default by the ingress controller.

Apache

The following assumptions are made by this config:

  • You have a (sub)domain for your KitchenOwl instance, e.g. kitchenowl.example.org
  • You are running the Docker images with ports mapped to 8080 on localhost (8080:8080)
  • You have Certbot (or another Let's Encrypt client) installed and running on your host system
  • You have Apache running on your host with mod_proxy, mod_proxy_http, mod_proxy_wstunnel, and mod_headers enabled
<VirtualHost *:80>
    ServerName kitchenowl.example.org
    ServerAdmin webmaster@example.org

    ErrorLog ${APACHE_LOG_DIR}/kitchenowl_error.log
    CustomLog ${APACHE_LOG_DIR}/kitchenowl_access.log combined

    Redirect permanent / https://kitchenowl.example.org/
</VirtualHost>

<VirtualHost *:443>
    ServerName kitchenowl.example.org
    ServerAdmin webmaster@example.org

    <IfModule mod_headers.c>
        Header always set Strict-Transport-Security "max-age=15552000; includeSubDomains; preload"
        RequestHeader set X-Forwarded-Proto "https"
    </IfModule>

    ErrorLog ${APACHE_LOG_DIR}/kitchenowl_error.log
    CustomLog ${APACHE_LOG_DIR}/kitchenowl_access.log combined

    ProxyPreserveHost On
    ProxyPass / http://localhost:8080/ upgrade=websocket
    ProxyPassReverse / http://localhost:8080/

    SSLCertificateFile /etc/letsencrypt/live/kitchenowl.example.org/fullchain.pem
    SSLCertificateKeyFile /etc/letsencrypt/live/kitchenowl.example.org/privkey.pem
    Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>

Nginx

The following assumptions are made by this config:

  • You have a (sub)domain for your KitchenOwl instance, e.g. kitchenowl.example.org
  • You are running the Docker images with ports mapped to 8080 on localhost (8080:8080)
  • You have Certbot (or another Let's Encrypt client) installed and running on your host system
  • You have Nginx running on your host on the default ports for HTTP/HTTPS (80/443)
server {
    server_name kitchenowl.example.org;
    listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot

    # https://www.nginx.com/blog/http-strict-transport-security-hsts-and-nginx/
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;

    location / {
        proxy_pass http://localhost:8080;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }

    ssl_certificate /etc/letsencrypt/live/kitchenowl.example.org/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/kitchenowl.example.org/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}

server {
    if ($host = kitchenowl.example.org) {
        return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name kitchenowl.example.org;
    listen 80;
    listen [::]:80;
    return 404; # managed by Certbot
}

Caddy

Caddy automatically sets up an SSL certificate and forwards WebSockets for the specified hostname.

kitchenowl.example.org {
    reverse_proxy localhost:8080 # Set the address of your KitchenOwl frontend here
    encode gzip
    header {
        X-Frame-Options "SAMEORIGIN"
        X-XSS-Protection "1; mode=block"
        X-Content-Type-Options "nosniff"
        Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
        Referrer-Policy "strict-origin-when-cross-origin"
    }
}