Skip to content

Conversation

@AntoniyaBK
Copy link

Description:

When deploying wger behind a reverse proxy or Cloudflare Tunnel, Django requires explicit configuration of allowed hosts and CSRF trusted origins.

This PR proposes updating prod.env with recommended settings to prevent common issues such as CSRF errors, redirect loops, or broken HTTPS detection.

Proposed Changes

In production, when using SSL/HTTPS, SITE_URL should be changed to https://yourdomain.com, also - Set DJANGO_ALLOWED_HOSTS and DJANGO_CSRF_TRUSTED_ORIGINS to your real domain with HTTPS.

# Site configuration 
SITE_URL=http://localhost
SITE_URL=https://yourdomain.com
DJANGO_ALLOWED_HOSTS=yourdomain.com
DJANGO_CSRF_TRUSTED_ORIGINS=https://yourdomain.com

Benefits:

Ensures correct HTTPS handling behind a reverse proxy or Cloudflare Tunnel
Note: Users must replace yourdomain.com with their actual domain.

Related Issue(s)

See also #134

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant