Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -439,4 +439,7 @@ Caddyfile :
path /{$AWS_STORAGE_BUCKET_NAME}* /{$AWS_STORAGE_PRIVATE_BUCKET_NAME}*
}
reverse_proxy @min_bucket minio:{$MINIO_PORT}
```
```

## Codabench Instance behind a reverse proxy
If you put your instance behind a reverse proxy and want that proxy to contact the instance via http or https, your `DOMAIN_NAME` might not be reachable from the outside. In this case, you can set `DOMAIN_NAME` as your internal domain name, used by the reverse proxy, and `EXTERNAL_DOMAIN_NAME` as the domain name that is known on external networks (like the internet).
18 changes: 12 additions & 6 deletions src/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,21 @@
csrf_https_domain = "https://" + os.environ.get("DOMAIN_NAME").split(':')[0]
csrf_http_domain = "http://" + os.environ.get("DOMAIN_NAME").split(':')[0]

CSRF_TRUSTED_ORIGINS = [csrf_https_domain, csrf_http_domain]
CSRF_ALLOWED_ORIGINS = [csrf_https_domain, csrf_http_domain]
if os.environ.get("EXTERNAL_DOMAIN_NAME", "") != "":
csrf_https_external_domain = "https://" + os.environ.get("EXTERNAL_DOMAIN_NAME", "").split(':')[0]
csrf_http_external_domain = "http://" + os.environ.get("EXTERNAL_DOMAIN_NAME", "").split(':')[0]
CSRF_TRUSTED_ORIGINS = [csrf_https_domain, csrf_http_domain, csrf_https_external_domain, csrf_http_external_domain]
CSRF_ALLOWED_ORIGINS = [csrf_https_domain, csrf_http_domain, csrf_https_external_domain, csrf_http_external_domain]

SITE_ID = 1
DOMAIN_NAME = os.environ.get('EXTERNAL_DOMAIN_NAME').split(':')[0]
else:
CSRF_TRUSTED_ORIGINS = [csrf_https_domain, csrf_http_domain]
CSRF_ALLOWED_ORIGINS = [csrf_https_domain, csrf_http_domain]

SITE_DOMAIN = os.environ.get('SITE_DOMAIN', 'http://localhost')
DOMAIN_NAME = os.environ.get('DOMAIN_NAME', 'localhost').split(':')[0]
DOMAIN_NAME = os.environ.get('DOMAIN_NAME', 'localhost').split(':')[0]

SELENIUM_HOSTNAME = os.environ.get("SELENIUM_HOSTNAME", "localhost")
SITE_DOMAIN = os.environ.get('SITE_DOMAIN', 'http://localhost')
SITE_ID = 1


THIRD_PARTY_APPS = (
Expand Down