TandoorRecipes / recipes

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

502: Error reading from remote server (Apache Reverse Proxy) #3181

Closed Maschda closed 3 weeks ago

Maschda commented 3 weeks ago

Issue

I have a fresh install of the latest version of Tandoor and i cant access the Website threw my Apache reverse proxy. Al i get is "502: Error reading from remote server". If i try to access the nginx container directly, the website does not load, or give any response back.

Has had anyone the same issue? Or can help me resolve it?

I would realy appreciate it. Thanks!

PS: If another Proxy is simply a better choice, im not bound to Apache.

Tandoor Version

latest

OS Version

Debian 12 bookworm

Setup

Docker / Docker-Compose

Reverse Proxy

Others (please state below)

Other

Apache

Environment file

# ---------------------------------------------------------------------------
# This template contains only required options.
# Visit the docs to find more https://docs.tandoor.dev/system/configuration/
# ---------------------------------------------------------------------------

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

# 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=db_recipes
POSTGRES_DB=djangodb
POSTGRES_PORT=5432
POSTGRES_USER=djangouser
POSTGRES_PASSWORD=*

Docker-Compose file

services:
  db_recipes:
    restart: always
    image: postgres:16-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env

  web_recipes:
    restart: always
    image: vabene1111/recipes
    env_file:
      - ./.env
    volumes:
      - staticfiles:/opt/recipes/staticfiles
      # Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
      - nginx_config:/opt/recipes/nginx/conf.d
      - ./mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes

  nginx_recipes:
    image: nginx:mainline-alpine
    restart: always
    ports:
      - 8081:8080
    env_file:
      - ./.env
    depends_on:
      - web_recipes
    volumes:
      # Do not make this a bind mount, see https://docs.tandoor.dev/install/docker/#volumes-vs-bind-mounts
      - nginx_config:/etc/nginx/conf.d:ro
      - staticfiles:/static:ro
      - ./mediafiles:/media:ro

volumes:
  nginx_config:
  staticfiles:

Relevant logs

nginx_recipes-1  | /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
nginx_recipes-1  | /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
nginx_recipes-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
nginx_recipes-1  | 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist
nginx_recipes-1  | /docker-entrypoint.sh: Sourcing /docker-entrypoint.d/15-local-resolvers.envsh
nginx_recipes-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
nginx_recipes-1  | /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
nginx_recipes-1  | /docker-entrypoint.sh: Configuration complete; ready for start up
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: using the "epoll" event method
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: nginx/1.27.0
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: built by gcc 13.2.1 20231014 (Alpine 13.2.1_git20231014) 
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: OS: Linux 6.8.4-3-pve
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 524288:524288
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: start worker processes
nginx_recipes-1  | 2024/06/10 12:59:00 [notice] 1#1: start worker process 21
smilerz commented 3 weeks ago

nginx runs on port 80 what are you trying to accomplish here?

  nginx_recipes:
    ports:
      - 8081:8080
Maschda commented 3 weeks ago

hm, i had it on 8080:8080. My understanding is that I select the port on which the nginx reverse proxy in this container is listening on. My reverse proxy forwards the connections from 443 to port 8080.

smilerz commented 3 weeks ago

nginx proxy listens on port 80

Maschda commented 3 weeks ago

Ok, i changed it back to 80 and now i can see a website. Without the Logo and everything looks a bit messed up. Then I tried the alternative Apache reverse proxy configuration from beedaddy and everything seems to work. Thank you!