Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot get images working - using Nginx Proxy Manager #3352

Open
danielwerner86 opened this issue Oct 8, 2024 · 0 comments
Open

Cannot get images working - using Nginx Proxy Manager #3352

danielwerner86 opened this issue Oct 8, 2024 · 0 comments
Labels
setup issue possibly or definitely an issue with the user setup

Comments

@danielwerner86
Copy link

danielwerner86 commented Oct 8, 2024

Issue

Hi!

I'm kind of new at this and am trying to get Tandoor working with Nginx Proxy Manager, and I cannot for the life of me understand how I need to configure the reverse proxy.

I've set 8080:8080 for Tandoor, and configured NPM to listen on the default 80, 81 and 443 ports. I also added this volume (not sure if it's needed?): /docker/tandoor/mediafiles:/media:ro

Then I've configured a new proxy host with this config:

Domain Names: recipes.myrealdomain.com
Scheme: http
Forward hostname/IP: my server IP
Forward Port: 8080

Everything works so far, I can reach the site but images get 404. I assume there's some mismatch with the folders but after a lot of googling I still don't understand what I'm doing wrong.

I tried adding this under "Custom locations":

Define location: /media/
Scheme: http
Forward hostname/IP: my server IP
Forward Port: 8080
Advanced parameters: root /docker/tandoor/mediafiles/; (I've tried both with and without anything there, tried alias /mediafiles/, nothing works)

I really appreciate an ELI5 here - how should I configure? :) Thank you!

Tandoor Version

1.5.19

OS Version

22.04.4 LTS

Setup

Docker / Docker-Compose

Reverse Proxy

Nginx Proxy Manager (NPM)

Other

No response

Environment file

# random secret key, use for example `base64 /dev/urandom | head -c50` to generate one
SECRET_KEY=Redacted

# allowed hosts (see documentation), should be set to your hostname(s) but might be * (default) for some proxies/provid># #ALLOWED_HOSTS=recipes.mydomain.com

# add only a database password if you want to run with the default postgres, otherwise change settings accordingly
DB_ENGINE=django.db.backends.postgresql
POSTGRES_HOST=tandoor-db
POSTGRES_DB=djangodb
POSTGRES_PORT=5432
POSTGRES_USER=djangouser
POSTGRES_PASSWORD=Redacted

DEBUG=0

Docker-Compose file

services:
  db:
    image: postgres:16-alpine
    container_name: tandoor-db
    hostname: tandoor-db
    volumes:
      - /docker/tandoor/db:/var/lib/postgresql/data
    env_file:
      - stack.env
    restart: always

  tandoor:
    image: vabene1111/recipes
    container_name: tandoor-web
    hostname: tandoor
    volumes:
      - /docker/tandoor/staticfiles:/opt/recipes/staticfiles
      - /docker/tandoor/mediafiles:/opt/recipes/mediafiles
    env_file:
      - stack.env
    ports:
      - 8080:8080
    depends_on:
      - db
    restart: always

Relevant logs

::ffff:192.168.16.1 - - [08/Oct/2024:21:47:41 +0200] "GET /media/recipes/1785aad8-b89c-4c37-9bcb-c389a60b2be8_1.jpg HTTP/1.1" 404 22549 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/129.0.0.0 Safari/537.36 Edg/129.0.0.0"
@danielwerner86 danielwerner86 added the setup issue possibly or definitely an issue with the user setup label Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
setup issue possibly or definitely an issue with the user setup
Projects
None yet
Development

No branches or pull requests

1 participant