TandoorRecipes / recipes

Application for managing recipes, planning meals, building shopping lists and much much more!
https://docs.tandoor.dev
Other
5.31k stars 555 forks source link

Sub Folder with External Reverse Proxy #2809

Closed NickSica closed 9 months ago

NickSica commented 9 months ago

Issue

I have an external Caddy reverse proxy serving a lot of different programs. I am trying to run tandoor in the /recipes subfolder, but it can't seem to fetch the static files due to a mix of using an external reverse proxy and the subfolder. Do I still need the nginx container running if I have an external reverse proxy and if so, how would that work with Caddy on the 80 port?

The logs say /recipes/staticfiles but I've tried a bunch of others like /recipes/static. Most of the time it can't find the files and the other half of the time it finds the files for the program that actually lives at the root of my site, the dashboard.

Debug

Gunicorn Media: False
Sqlite: True
Debug: True

SERVER_PROTOCOL:HTTP/1.1
REMOTE_ADDR:10.0.2.100
SERVER_PORT:8080

HTTP_HOST:sicalabs.com
HTTP_USER_AGENT:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36
HTTP_ACCEPT:text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7
HTTP_ACCEPT_ENCODING:gzip, deflate, br
HTTP_ACCEPT_LANGUAGE:en-US,en;q=0.9
HTTP_COOKIE:csrftoken=OtVzXzBtoY0EjgPAT7JMXxIAuQYHbr9I; sessionid=6h5co1i42zt47d2ub4ysrw0oci2tkv2j; authelia_session=QFHPa_WlDMS9Ka0gkJLfykFPoc3mhwTK
HTTP_REFERER:https://sicalabs.com/recipes/search/
HTTP_REMOTE_EMAIL:nick@nisicalab.com
HTTP_REMOTE_GROUPS:jellyfinUsers,jellyfinAdmins
HTTP_REMOTE_NAME:
HTTP_REMOTE_USER:nick
HTTP_SEC_CH_UA:"Not_A Brand";v="8", "Chromium";v="120", "Google Chrome";v="120"
HTTP_SEC_CH_UA_MOBILE:?0
HTTP_SEC_CH_UA_PLATFORM:"Windows"
HTTP_SEC_FETCH_DEST:empty
HTTP_SEC_FETCH_MODE:navigate
HTTP_SEC_FETCH_SITE:same-origin
HTTP_UPGRADE_INSECURE_REQUESTS:1
HTTP_X_FORWARDED_FOR:144.118.75.38
HTTP_X_FORWARDED_HOST:sicalabs.com
HTTP_X_FORWARDED_PROTO:https
HTTP_X_SCRIPT_NAME:/recipes

wsgi.errors:<gunicorn.http.wsgi.WSGIErrorsWrapper object at 0x7f13d67aead0>
wsgi.version:(1, 0)
wsgi.multithread:True
wsgi.multiprocess:True
wsgi.run_once:False
wsgi.file_wrapper:
wsgi.input_terminated:True
wsgi.input:<gunicorn.http.body.Body object at 0x7f13d666e740>
wsgi.url_scheme:http

Caddy Config This is the file for the specific path(My Caddy configuration is split into many files, per path)

@tandoor path /recipes /recipes/*
handle @tandoor {
    handle_path /media/* {
        root * /mnt/mediaserver/recipes
        file_server
    }

    reverse_proxy localhost:5656 {
        ## This import needs to be included if you're relying on a trusted proxies configuration.
        import trusted_proxy_list
        header_up X_SCRIPT_NAME /recipes
        header_down Set-Cookie "path=/" "path=/recipes"
    }
}

Tandoor Version

commit abf8f791360b2bc4a5c7d011877668679bcbb3f2

OS Version

ArchLinux

Setup

Docker / Docker-Compose

Reverse Proxy

Caddy

Other

No response

Environment file

# only set this to true when testing/debugging
# when unset: 1 (true) - dont unset this, just for development
DEBUG=1
SQL_DEBUG=0
DEBUG_TOOLBAR=0
# Gunicorn log level for debugging (default value is "info" when unset)
# (see https://docs.gunicorn.org/en/stable/settings.html#loglevel for available settings)
# GUNICORN_LOG_LEVEL="debug"

# HTTP port to bind to
# TANDOOR_PORT=8080

# hosts the application can run under e.g. recipes.mydomain.com,cooking.mydomain.com,...
ALLOWED_HOSTS=*

# Cross Site Request Forgery protection
# (https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS)
# CSRF_TRUSTED_ORIGINS = []

# Cross Origin Resource Sharing
# (https://github.com/adamchainz/django-cors-header)
# CORS_ALLOW_ALL_ORIGINS = True

# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
# ---------------------------- AT LEAST ONE REQUIRED -------------------------
SECRET_KEY=--REDACTED--
SECRET_KEY_FILE=
# ---------------------------------------------------------------

# your default timezone See https://timezonedb.com/time-zones for a list of timezones
TZ=US/Eastern

# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql
# DB_OPTIONS= {} # e.g. {"sslmode":"require"} to enable ssl
POSTGRES_HOST=tandoordb
POSTGRES_PORT=5432
POSTGRES_USER=--REDACTED--
# ---------------------------- AT LEAST ONE REQUIRED -------------------------
POSTGRES_PASSWORD=--REDACTED--
POSTGRES_PASSWORD_FILE=
# ---------------------------------------------------------------
POSTGRES_DB=tandoordb

# database connection string, when used overrides other database settings.
# format might vary depending on backend
# DATABASE_URL = engine://username:password@host:port/dbname

# the default value for the user preference 'fractions' (enable/disable fraction support)
# default: disabled=0
FRACTION_PREF_DEFAULT=0

# the default value for the user preference 'comments' (enable/disable commenting system)
# default comments enabled=1
COMMENT_PREF_DEFAULT=1

# Users can set a amount of time after which the shopping list is refreshed when they are in viewing mode
# This is the minimum interval users can set. Setting this to low will allow users to refresh very frequently which
# might cause high load on the server. (Technically they can obviously refresh as often as they want with their own scripts)
SHOPPING_MIN_AUTOSYNC_INTERVAL=5

# Default for user setting sticky navbar
# STICKY_NAV_PREF_DEFAULT=1

# If base URL is something other than just / (you are serving a subfolder in your proxy for instance http://recipe_app/recipes/)
# Be sure to not have a trailing slash: e.g. '/recipes' instead of '/recipes/'
SCRIPT_NAME=/recipes

# If staticfiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
STATIC_URL=/recipes/staticfiles/

# If mediafiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
MEDIA_URL=/recipes/mediafiles/

# Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. Please use any of the examples
# provided that include an additional nxginx container to handle media file serving.
# If you know what you are doing turn this back on (1) to serve media files using djangos serve() method.
# when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate
GUNICORN_MEDIA=0

# GUNICORN SERVER RELATED SETTINGS (see https://docs.gunicorn.org/en/stable/design.html#how-many-workers for recommended settings)
# GUNICORN_WORKERS=1
# GUNICORN_THREADS=1

# S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio)
# as long as S3_ACCESS_KEY is not set S3 features are disabled
# S3_ACCESS_KEY=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION_NAME= # default none, set your region might be required
# S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls
# S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for
# S3_ENDPOINT_URL= # when using a custom endpoint like minio
# S3_CUSTOM_DOMAIN= # when using a CDN/proxy to S3 (see https://github.com/TandoorRecipes/recipes/issues/1943)

# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# email sender address (default 'webmaster@localhost')
# DEFAULT_FROM_EMAIL=
# prefix used for account related emails (default "[Tandoor Recipes] ")
# ACCOUNT_EMAIL_SUBJECT_PREFIX=

# allow authentication via the REMOTE-USER header (can be used for e.g. authelia).
# ATTENTION: Leave off if you don't know what you are doing! Enabling this without proper configuration will enable anybody
#   to login with any username!
# See docs for additional information: https://docs.tandoor.dev/features/authentication/#reverse-proxy-authentication
# when unset: 0 (false)
REMOTE_USER_AUTH=0

# Default settings for spaces, apply per space and can be changed in the admin view
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
# SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space
# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
# SPACE_DEFAULT_ALLOW_SHARING=1 # Allow users to share recipes with public links

# allow people to create local accounts on your application instance (without an invite link)
# social accounts will always be able to sign up
# when unset: 0 (false)
# ENABLE_SIGNUP=0

# If signup is enabled you might want to add a captcha to it to prevent spam
# HCAPTCHA_SITEKEY=
# HCAPTCHA_SECRET=

# if signup is enabled you might want to provide urls to data protection policies or terms and conditions
# TERMS_URL=
# PRIVACY_URL=
# IMPRINT_URL=

# enable serving of prometheus metrics under the /metrics path
# ATTENTION: view is not secured (as per the prometheus default way) so make sure to secure it
# trough your web server (or leave it open of you dont care if the stats are exposed)
# ENABLE_METRICS=0

# allows you to setup OAuth providers
# see docs for more information https://docs.tandoor.dev/features/authentication/
# SOCIAL_PROVIDERS = allauth.socialaccount.providers.github, allauth.socialaccount.providers.nextcloud,

# Should a newly created user from a social provider get assigned to the default space and given permission by default ?
# ATTENTION: This feature might be deprecated in favor of a space join and public viewing system in the future
# default 0 (false), when 1 (true) users will be assigned space and group
# SOCIAL_DEFAULT_ACCESS = 1

# if SOCIAL_DEFAULT_ACCESS is used, which group should be added
# SOCIAL_DEFAULT_GROUP=guest

# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications
# when running under the same database
# SESSION_COOKIE_DOMAIN=.example.com
# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain

# by default SORT_TREE_BY_NAME is disabled this will store all Keywords and Food in the order they are created
# enabling this setting makes saving new keywords and foods very slow, which doesn't matter in most usecases.
# however, when doing large imports of recipes that will create new objects, can increase total run time by 10-15x
# Keywords and Food can be manually sorted by name in Admin
# This value can also be temporarily changed in Admin, it will revert the next time the application is started
# This will be fixed/changed in the future by changing the implementation or finding a better workaround for sorting
# SORT_TREE_BY_NAME=0
# LDAP authentication
# default 0 (false), when 1 (true) list of allowed users will be fetched from LDAP server
#LDAP_AUTH=
#AUTH_LDAP_SERVER_URI=
#AUTH_LDAP_BIND_DN=
#AUTH_LDAP_BIND_PASSWORD=
#AUTH_LDAP_USER_SEARCH_BASE_DN=
#AUTH_LDAP_TLS_CACERTFILE=
#AUTH_LDAP_START_TLS=

# Enables exporting PDF (see export docs)
# Disabled by default, uncomment to enable
# ENABLE_PDF_EXPORT=1

# Recipe exports are cached for a certain time by default, adjust time if needed
# EXPORT_FILE_CACHE_DURATION=600

# if you want to do many requests to the FDC API you need to get a (free) API key. Demo key is limited to 30 requests / hour or 50 requests / day
#FDC_API_KEY=DEMO_KEY

Docker-Compose file

It's not a docker-compose and it uses podman, but the effect is the same

podman pod create --replace -p 5656:8080 tandoor

podman run \
  --pod tandoor \
  --name tandoordb \
  --rm \
  --detach \
  --replace \
  --env-file ~/configs/tandoor/.env \
  --volume /home/podman/configs/tandoor/data:/var/lib/postgresql/data:Z,U \
  docker.io/postgres:15-alpine

podman run \
  --label "io.containers.autoupdate=image" \
  --pod tandoor \
  --name tandoorweb \
  --rm \
  --replace \
  --requires tandoordb \
  --group-add keep-groups \
  --env-file ~/configs/tandoor/.env \
  --volume ~/configs/tandoor/static:/opt/recipes/staticfiles \
  --mount type=bind,source=/mnt/mediaserver/recipes,destination=/opt/recipes/mediafiles \
  docker.io/vabene1111/recipes:latest

Relevant logs

10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/accounts/login/?next=/recipes/search/ HTTP/1.1" 200 7796 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/tandoor.min.css
Not Found: /recipes/staticfiles/themes/tandoor.min.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/themes/tandoor.min.css HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/brand_logo.png
Not Found: /recipes/staticfiles/assets/brand_logo.png
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/assets/brand_logo.png HTTP/1.1" 404 22389 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/select2.min.js
Not Found: /recipes/staticfiles/js/select2.min.js
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/js/select2.min.js HTTP/1.1" 404 22377 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/js/jquery-3.5.1.min.js HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/app.min.css
Not Found: /recipes/staticfiles/css/app.min.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/css/app.min.css HTTP/1.1" 404 22371 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/popper.min.js
Not Found: /recipes/staticfiles/js/popper.min.js
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/js/popper.min.js HTTP/1.1" 404 22374 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/bootstrap.min.js
Not Found: /recipes/staticfiles/js/bootstrap.min.js
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/js/bootstrap.min.js HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:14:59:34 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/favicon.svg
Not Found: /recipes/staticfiles/assets/favicon.svg
10.0.2.100 - - [14/Dec/2023:14:59:35 -0500] "GET /recipes/staticfiles/assets/favicon.svg HTTP/1.1" 404 22380 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/favicon-32x32.png
Not Found: /recipes/staticfiles/assets/favicon-32x32.png
10.0.2.100 - - [14/Dec/2023:14:59:35 -0500] "GET /recipes/staticfiles/assets/favicon-32x32.png HTTP/1.1" 404 22398 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:14:59:35 -0500] "GET /recipes/manifest.json HTTP/1.1" 200 1113 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/favicon-16x16.png
Not Found: /recipes/staticfiles/assets/favicon-16x16.png
10.0.2.100 - - [14/Dec/2023:14:59:35 -0500] "GET /recipes/staticfiles/assets/favicon-16x16.png HTTP/1.1" 404 22398 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/ HTTP/1.1" 302 0 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/search/ HTTP/1.1" 200 22681 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/tandoor.min.css
Not Found: /recipes/staticfiles/themes/tandoor.min.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/themes/tandoor.min.css HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/popper.min.js
Not Found: /recipes/staticfiles/js/popper.min.js
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/js/popper.min.js HTTP/1.1" 404 22374 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/js/jquery-3.5.1.min.js HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/bootstrap.min.js
Not Found: /recipes/staticfiles/js/bootstrap.min.js
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/js/bootstrap.min.js HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/app.min.css
Not Found: /recipes/staticfiles/css/app.min.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/css/app.min.css HTTP/1.1" 404 22371 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/django_js_reverse/reverse.js
Not Found: /recipes/staticfiles/django_js_reverse/reverse.js
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/django_js_reverse/reverse.js HTTP/1.1" 404 22410 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/select2.min.js
Not Found: /recipes/staticfiles/js/select2.min.js
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/js/select2.min.js HTTP/1.1" 404 22377 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/brand_logo.png
Not Found: /recipes/staticfiles/assets/brand_logo.png
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/assets/brand_logo.png HTTP/1.1" 404 22389 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/vue/js/locales-chunk.js
Not Found: /recipes/staticfiles/vue/js/locales-chunk.js
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/vue/js/locales-chunk.js HTTP/1.1" 404 22395 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/vue/js/api-chunk.js
Not Found: /recipes/staticfiles/vue/js/api-chunk.js
10.0.2.100 - - [14/Dec/2023:15:05:09 -0500] "GET /recipes/staticfiles/vue/js/api-chunk.js HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/vue/css/recipe_search_view.css
Not Found: /recipes/staticfiles/vue/css/recipe_search_view.css
Not Found: /recipes/staticfiles/vue/css/chunk-vendors.css
Not Found: /recipes/staticfiles/vue/css/chunk-vendors.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/vue/js/recipe_search_view.js
Not Found: /recipes/staticfiles/vue/js/recipe_search_view.js
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/vue/css/chunk-vendors.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/vue/js/recipe_search_view.js HTTP/1.1" 404 22410 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/vue/css/recipe_search_view.css HTTP/1.1" 404 22416 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/vue/js/chunk-vendors.js
Not Found: /recipes/staticfiles/vue/js/chunk-vendors.js
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/vue/js/chunk-vendors.js HTTP/1.1" 404 22395 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/vue/css/chunk-vendors.css
Not Found: /recipes/staticfiles/vue/css/chunk-vendors.css
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/vue/css/chunk-vendors.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/vue/css/recipe_search_view.css
Not Found: /recipes/staticfiles/vue/css/recipe_search_view.css
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/staticfiles/vue/css/recipe_search_view.css HTTP/1.1" 404 22416 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:10 -0500] "GET /recipes/manifest.json HTTP/1.1" 200 1113 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:11 -0500] "GET /recipes/service-worker.js HTTP/1.1" 200 33402 "https://sicalabs.com/recipes/service-worker.js" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/system/ HTTP/1.1" 200 25883 "https://sicalabs.com/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/app.min.css
Not Found: /recipes/staticfiles/css/app.min.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/css/app.min.css HTTP/1.1" 404 22371 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/js/select2.min.js
Not Found: /recipes/staticfiles/js/select2.min.js
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/js/select2.min.js HTTP/1.1" 404 22377 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/bootstrap.min.js
Not Found: /recipes/staticfiles/js/bootstrap.min.js
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/js/bootstrap.min.js HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/tandoor.min.css
Not Found: /recipes/staticfiles/themes/tandoor.min.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/themes/tandoor.min.css HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/popper.min.js
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/js/popper.min.js
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/js/popper.min.js HTTP/1.1" 404 22374 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/js/jquery-3.5.1.min.js HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/brand_logo.png
Not Found: /recipes/staticfiles/assets/brand_logo.png
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/assets/brand_logo.png HTTP/1.1" 404 22389 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:15:05:12 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:13 -0500] "GET /recipes/manifest.json HTTP/1.1" 200 1113 "https://sicalabs.com/recipes/system/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:15:05:14 -0500] "GET /recipes/service-worker.js HTTP/1.1" 200 33402 "https://sicalabs.com/recipes/service-worker.js" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
smilerz commented 9 months ago

subfolder configurations requires setting the script_name header proxy_set_header X-Script-Name /subfolder;

as well as the .env variable SCRIPT_NAME=/subfolder

NickSica commented 9 months ago

HTTP_X_SCRIPT_NAME:/recipes

I think those are both set above, unless I'm mistaken? In the .env file and the Debug reports that X-Script-Name is set.

smilerz commented 9 months ago

These are not URLs and shouldn't be set unless you are intentionally trying to change the location from defaults.

STATIC_URL=/recipes/staticfiles/
MEDIA_URL=/recipes/mediafiles/
NickSica commented 9 months ago

These are not URLs and shouldn't be set unless you are intentionally trying to change the location from defaults.

STATIC_URL=/recipes/staticfiles/
MEDIA_URL=/recipes/mediafiles/

yeah this part I was a bit confused about. I don't want it to go to the root of the site to grab files(without these it grabs my dashboard's static files since it points to domain.com/static instead of domain.com/recipes/static). Should these still be unset in a subfolder configuration or should I use a full URL for these?

smilerz commented 9 months ago

you can change them - but you are hosting your media at/media/* not mediafiles

I never changing my static to use the built-in serving, so am not 100% certain exactly how that operates. but if you want to be explicit about the path you'll need to serve ~/configs/tandoor/static with your reverse proxy as well.

NickSica commented 9 months ago

you can change them - but you are hosting your media at/media/* not mediafiles

I never changing my static to use the built-in serving, so am not 100% certain exactly how that operates. but if you want to be explicit about the path you'll need to serve ~/configs/tandoor/static with your reverse proxy as well.

So create a similar block as the media block, but with static paths? Also change everything to match mediafiles/staticfiles in Caddy?

As a side note, I tried setting everything to /static instead of /staticfiles but it seems /staticfiles may be hardcoded early in the boot-up process because it was still using that folder.

smilerz commented 9 months ago

Yes - similar. You can either change the hosted path to /mediafiles or the media_url to /recipes/media - they just have to match

NickSica commented 9 months ago

I did that and the same issue is prevalent with the same errors.

smilerz commented 9 months ago

Can you please share the logs for your proxy and tandoor along with the current configs.

NickSica commented 9 months ago

Can you please share the logs for your proxy and tandoor along with the current configs.

I was just recopying the current configuration into a response. I'll grab the Caddy logs now, but here's everything else.

Caddy

@tandoor path /recipes /recipes/*
handle @tandoor {
    handle_path /mediafiles/* {
        root * /mnt/mediaserver/recipes
        file_server
    }

    handle_path /staticfiles/* {
        root * /home/podman/configs/tandoor/static
        file_server
    }

    reverse_proxy localhost:5656 {
        ## This import needs to be included if you're relying on a trusted proxies configuration.
        import trusted_proxy_list
        header_up X_SCRIPT_NAME /recipes
        header_down Set-Cookie "path=/" "path=/recipes"
    }
}

.env File

# only set this to true when testing/debugging
# when unset: 1 (true) - dont unset this, just for development
DEBUG=1
SQL_DEBUG=0
DEBUG_TOOLBAR=0
# Gunicorn log level for debugging (default value is "info" when unset)
# (see https://docs.gunicorn.org/en/stable/settings.html#loglevel for available settings)
# GUNICORN_LOG_LEVEL="debug"

# HTTP port to bind to
# TANDOOR_PORT=8080

# hosts the application can run under e.g. recipes.mydomain.com,cooking.mydomain.com,...
ALLOWED_HOSTS=*

# Cross Site Request Forgery protection
# (https://docs.djangoproject.com/en/4.2/ref/settings/#std-setting-CSRF_TRUSTED_ORIGINS)
# CSRF_TRUSTED_ORIGINS = []

# Cross Origin Resource Sharing
# (https://github.com/adamchainz/django-cors-header)
# CORS_ALLOW_ALL_ORIGINS = True

# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
# ---------------------------- AT LEAST ONE REQUIRED -------------------------
SECRET_KEY=--REDACTED--
SECRET_KEY_FILE=
# ---------------------------------------------------------------

# your default timezone See https://timezonedb.com/time-zones for a list of timezones
TZ=US/Eastern

# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql
# DB_OPTIONS= {} # e.g. {"sslmode":"require"} to enable ssl
POSTGRES_HOST=tandoordb
POSTGRES_PORT=5432
POSTGRES_USER=--REDACTED--
# ---------------------------- AT LEAST ONE REQUIRED -------------------------
POSTGRES_PASSWORD=--REDACTED--
POSTGRES_PASSWORD_FILE=
# ---------------------------------------------------------------
POSTGRES_DB=tandoordb

# database connection string, when used overrides other database settings.
# format might vary depending on backend
# DATABASE_URL = engine://username:password@host:port/dbname

# the default value for the user preference 'fractions' (enable/disable fraction support)
# default: disabled=0
FRACTION_PREF_DEFAULT=0

# the default value for the user preference 'comments' (enable/disable commenting system)
# default comments enabled=1
COMMENT_PREF_DEFAULT=1

# Users can set a amount of time after which the shopping list is refreshed when they are in viewing mode
# This is the minimum interval users can set. Setting this to low will allow users to refresh very frequently which
# might cause high load on the server. (Technically they can obviously refresh as often as they want with their own scripts)
SHOPPING_MIN_AUTOSYNC_INTERVAL=5

# Default for user setting sticky navbar
# STICKY_NAV_PREF_DEFAULT=1

# If base URL is something other than just / (you are serving a subfolder in your proxy for instance http://recipe_app/recipes/)
# Be sure to not have a trailing slash: e.g. '/recipes' instead of '/recipes/'
SCRIPT_NAME=/recipes

# If staticfiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
STATIC_URL=https://sicalabs.com/recipes/staticfiles/

# If mediafiles are stored at a different location uncomment and change accordingly, MUST END IN /
# this is not required if you are just using a subfolder
# This can either be a relative path from the applications base path or the url of an external host
MEDIA_URL=https://sicalabs.com/recipes/mediafiles/

# Serve mediafiles directly using gunicorn. Basically everyone recommends not doing this. Please use any of the examples
# provided that include an additional nxginx container to handle media file serving.
# If you know what you are doing turn this back on (1) to serve media files using djangos serve() method.
# when unset: 1 (true) - this is temporary until an appropriate amount of time has passed for everyone to migrate
GUNICORN_MEDIA=0

# GUNICORN SERVER RELATED SETTINGS (see https://docs.gunicorn.org/en/stable/design.html#how-many-workers for recommended settings)
# GUNICORN_WORKERS=1
# GUNICORN_THREADS=1

# S3 Media settings: store mediafiles in s3 or any compatible storage backend (e.g. minio)
# as long as S3_ACCESS_KEY is not set S3 features are disabled
# S3_ACCESS_KEY=
# S3_SECRET_ACCESS_KEY=
# S3_BUCKET_NAME=
# S3_REGION_NAME= # default none, set your region might be required
# S3_QUERYSTRING_AUTH=1 # default true, set to 0 to serve media from a public bucket without signed urls
# S3_QUERYSTRING_EXPIRE=3600 # number of seconds querystring are valid for
# S3_ENDPOINT_URL= # when using a custom endpoint like minio
# S3_CUSTOM_DOMAIN= # when using a CDN/proxy to S3 (see https://github.com/TandoorRecipes/recipes/issues/1943)

# Email Settings, see https://docs.djangoproject.com/en/3.2/ref/settings/#email-host
# Required for email confirmation and password reset (automatically activates if host is set)
# EMAIL_HOST=
# EMAIL_PORT=
# EMAIL_HOST_USER=
# EMAIL_HOST_PASSWORD=
# EMAIL_USE_TLS=0
# EMAIL_USE_SSL=0
# email sender address (default 'webmaster@localhost')
# DEFAULT_FROM_EMAIL=
# prefix used for account related emails (default "[Tandoor Recipes] ")
# ACCOUNT_EMAIL_SUBJECT_PREFIX=

# allow authentication via the REMOTE-USER header (can be used for e.g. authelia).
# ATTENTION: Leave off if you don't know what you are doing! Enabling this without proper configuration will enable anybody
#   to login with any username!
# See docs for additional information: https://docs.tandoor.dev/features/authentication/#reverse-proxy-authentication
# when unset: 0 (false)
REMOTE_USER_AUTH=0

# Default settings for spaces, apply per space and can be changed in the admin view
# SPACE_DEFAULT_MAX_RECIPES=0 # 0=unlimited recipes
# SPACE_DEFAULT_MAX_USERS=0 # 0=unlimited users per space
# SPACE_DEFAULT_MAX_FILES=0 # Maximum file storage for space in MB. 0 for unlimited, -1 to disable file upload.
# SPACE_DEFAULT_ALLOW_SHARING=1 # Allow users to share recipes with public links

# allow people to create local accounts on your application instance (without an invite link)
# social accounts will always be able to sign up
# when unset: 0 (false)
# ENABLE_SIGNUP=0

# If signup is enabled you might want to add a captcha to it to prevent spam
# HCAPTCHA_SITEKEY=
# HCAPTCHA_SECRET=

# if signup is enabled you might want to provide urls to data protection policies or terms and conditions
# TERMS_URL=
# PRIVACY_URL=
# IMPRINT_URL=

# enable serving of prometheus metrics under the /metrics path
# ATTENTION: view is not secured (as per the prometheus default way) so make sure to secure it
# trough your web server (or leave it open of you dont care if the stats are exposed)
# ENABLE_METRICS=0

# allows you to setup OAuth providers
# see docs for more information https://docs.tandoor.dev/features/authentication/
# SOCIAL_PROVIDERS = allauth.socialaccount.providers.github, allauth.socialaccount.providers.nextcloud,

# Should a newly created user from a social provider get assigned to the default space and given permission by default ?
# ATTENTION: This feature might be deprecated in favor of a space join and public viewing system in the future
# default 0 (false), when 1 (true) users will be assigned space and group
# SOCIAL_DEFAULT_ACCESS = 1

# if SOCIAL_DEFAULT_ACCESS is used, which group should be added
# SOCIAL_DEFAULT_GROUP=guest

# Django session cookie settings. Can be changed to allow a single django application to authenticate several applications
# when running under the same database
# SESSION_COOKIE_DOMAIN=.example.com
# SESSION_COOKIE_NAME=sessionid # use this only to not interfere with non unified django applications under the same top level domain

# by default SORT_TREE_BY_NAME is disabled this will store all Keywords and Food in the order they are created
# enabling this setting makes saving new keywords and foods very slow, which doesn't matter in most usecases.
# however, when doing large imports of recipes that will create new objects, can increase total run time by 10-15x
# Keywords and Food can be manually sorted by name in Admin
# This value can also be temporarily changed in Admin, it will revert the next time the application is started
# This will be fixed/changed in the future by changing the implementation or finding a better workaround for sorting
# SORT_TREE_BY_NAME=0
# LDAP authentication
# default 0 (false), when 1 (true) list of allowed users will be fetched from LDAP server
#LDAP_AUTH=
#AUTH_LDAP_SERVER_URI=
#AUTH_LDAP_BIND_DN=
#AUTH_LDAP_BIND_PASSWORD=
#AUTH_LDAP_USER_SEARCH_BASE_DN=
#AUTH_LDAP_TLS_CACERTFILE=
#AUTH_LDAP_START_TLS=

# Enables exporting PDF (see export docs)
# Disabled by default, uncomment to enable
# ENABLE_PDF_EXPORT=1

# Recipe exports are cached for a certain time by default, adjust time if needed
# EXPORT_FILE_CACHE_DURATION=600

# if you want to do many requests to the FDC API you need to get a (free) API key. Demo key is limited to 30 requests / hour or 50 requests / day
#FDC_API_KEY=DEMO_KEY

Tandoor Log

Checking configuration...
Waiting for database to be ready...
Database is ready
Migrating database
Operations to perform:
  Apply all migrations: account, admin, auth, authtoken, contenttypes, cookbook, oauth2_provider, sessions, sites, socialaccount
Running migrations:
  No migrations to apply.
Generating static files
js-reverse file written to /opt/recipes/cookbook/static/django_js_reverse

1 static file copied to '/opt/recipes/staticfiles', 640 unmodified, 1379 post-processed.
Done
[2023-12-14 18:51:14 -0500] [1] [INFO] Starting gunicorn 20.1.0
[2023-12-14 18:51:14 -0500] [1] [INFO] Listening at: http://0.0.0.0:8080 (1)
[2023-12-14 18:51:14 -0500] [1] [INFO] Using worker: gthread
[2023-12-14 18:51:14 -0500] [7] [INFO] Booting worker with pid: 7
[2023-12-14 18:51:14 -0500] [8] [INFO] Booting worker with pid: 8
[2023-12-14 18:51:14 -0500] [9] [INFO] Booting worker with pid: 9
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/accounts/login/?next=/recipes/search/ HTTP/1.1" 200 8156 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/app.min.css
Not Found: /recipes/staticfiles/css/app.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/css/app.min.css HTTP/1.1" 404 22371 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
Not Found: /recipes/staticfiles/js/jquery-3.5.1.min.js
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/js/jquery-3.5.1.min.js HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/popper.min.js
Not Found: /recipes/staticfiles/js/popper.min.js
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/js/popper.min.js HTTP/1.1" 404 22374 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/bootstrap.min.js
Not Found: /recipes/staticfiles/js/bootstrap.min.js
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/js/bootstrap.min.js HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/js/select2.min.js
Not Found: /recipes/staticfiles/js/select2.min.js
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/js/select2.min.js HTTP/1.1" 404 22377 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/assets/brand_logo.png
Not Found: /recipes/staticfiles/assets/brand_logo.png
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/assets/brand_logo.png HTTP/1.1" 404 22389 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/tandoor.min.css
Not Found: /recipes/staticfiles/themes/tandoor.min.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/themes/tandoor.min.css HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:18:51:20 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/tandoor.min.css
Not Found: /recipes/staticfiles/themes/tandoor.min.css
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/staticfiles/themes/tandoor.min.css HTTP/1.1" 404 22392 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/staticfiles/fontawesome/fontawesome_all.min.css HTTP/1.1" 404 22431 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2.min.css
Not Found: /recipes/staticfiles/css/select2.min.css
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/staticfiles/css/select2.min.css HTTP/1.1" 404 22383 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/app.min.css
Not Found: /recipes/staticfiles/css/app.min.css
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/staticfiles/css/app.min.css HTTP/1.1" 404 22371 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/manifest.json HTTP/1.1" 200 1113 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
Not Found: /recipes/staticfiles/themes/select2-bootstrap-theme.css
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/staticfiles/themes/select2-bootstrap-theme.css HTTP/1.1" 404 22428 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
Not Found: /recipes/staticfiles/css/select2-bootstrap.css
10.0.2.100 - - [14/Dec/2023:18:51:24 -0500] "GET /recipes/staticfiles/css/select2-bootstrap.css HTTP/1.1" 404 22401 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
10.0.2.100 - - [14/Dec/2023:18:51:33 -0500] "GET /recipes/manifest.json HTTP/1.1" 200 1113 "https://sicalabs.com/recipes/accounts/login/?next=/recipes/search/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36"
smilerz commented 9 months ago

Your reverse proxy isn't serving static files. It's passing it to tandoor.

Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/
NickSica commented 9 months ago

Your reverse proxy isn't serving static files. It's passing it to tandoor.

Not Found: /recipes/staticfiles/fontawesome/fontawesome_all.min.css
Not Found: /recipes/staticfiles/fontawesome/

It's set up to serve them I think, I used that example you sent me in the other thread to set it up and it looks like the documentation.

smilerz commented 9 months ago

I can only tell you that it's not working as Django is receiving the GET requests.

I don't know Caddy, but right now that's the root problem.

NickSica commented 9 months ago

Thank you for your help, it was a weirdness with Caddy. There are some lingering hardcoded fonts and an icon that I think may be a bug though.

image

For anyone who comes by this in the future, here is the solution I figured out. I'm sure there's a better way, but it works for me.

First file_server doesn't work with directories under the home folder if Caddy is run with systemd so you need to move any files you're serving elsewhere, I used /srv/tandoor. Second the handle_path vs handle when used with file_server is funky, it changes paths up weirdly. The final Caddy config is below and the .env file is the same as above. Lastly, /srv/tandoor is mounted to the directory instead of the configs folder.

Caddy Config

@tandoor path /recipes /recipes/*
handle @tandoor {
    handle_path /recipes/staticfiles* {
        root * /srv/tandoor
        file_server
    }

    handle_path /recipes/mediafiles* {
        root * /mnt/mediaserver/recipes
        file_server
    }

    reverse_proxy localhost:5656 {
        ## This import needs to be included if you're relying on a trusted proxies configuration.
        import trusted_proxy_list
        header_up X_SCRIPT_NAME /recipes
        header_down Set-Cookie "path=/" "path=/recipes"
    }
}