{% extends 'workflows/base_shell.html' %} {% load static i18n %} {% block title %}{% trans "Host & Domain Setup" %}{% endblock %} {% block extra_css %} {% endblock %} {% block shell_body %} {% include 'workflows/includes/app_header.html' with header_show_home=1 header_inside_shell=1 %}
{% trans "Reference for configuring hostnames and origins correctly in Django deployments, including how to fix Invalid HTTP_HOST errors." %}
{% trans "Django rejects requests whose Host header is not present in ALLOWED_HOSTS. This validation runs before normal page routing, so a broken hostname cannot show a friendly in-app error page on that same host." %}
{% trans "Use this guide from a working hostname or IP address to correct the environment configuration." %}
APP_DOMAIN: {% trans "canonical hostname without scheme, for example" %} workdock.bostame.deAPP_BASE_URL: {% trans "canonical external URL with scheme, for example" %} https://workdock.bostame.deDJANGO_ALLOWED_HOSTS: {% trans "comma-separated hostnames and IPs allowed to reach the app" %}DJANGO_CSRF_TRUSTED_ORIGINS: {% trans "comma-separated origins with scheme for POST and CSRF-safe requests" %}{% trans "The application automatically adds APP_DOMAIN and the hostname from APP_BASE_URL to the effective host allow-list. APP_BASE_URL is also added to trusted CSRF origins." %}
APP_DOMAIN=workdock.bostame.de
APP_BASE_URL=https://workdock.bostame.de
DJANGO_ALLOWED_HOSTS=192.168.2.55,localhost,127.0.0.1
DJANGO_CSRF_TRUSTED_ORIGINS=http://192.168.2.55:8088,https://workdock.bostame.de
APP_DOMAIN=workdock.example.com
APP_BASE_URL=https://workdock.example.com
DJANGO_ALLOWED_HOSTS=workdock.example.com
DJANGO_CSRF_TRUSTED_ORIGINS=https://workdock.example.com
{% trans "Production should run with HTTPS, DEBUG disabled, secure cookies enabled, and SSL redirect enabled." %}
/opt/workdock/.env.testcd /opt/workdock
nano .env.test
RUN_DJANGO_CHECK=0 DEPLOY_HEALTH_URL="http://127.0.0.1:8088/healthz/" ./scripts/deploy_stack.sh .env.test docker-compose.prod.yml
DJANGO_ALLOWED_HOSTS: {% trans "hostnames only, no scheme" %}DJANGO_CSRF_TRUSTED_ORIGINS: {% trans "must include scheme, for example" %} https://workdock.bostame.de