Nexcloud with 404 error, everything else works

So I decided to create a stack to use with my docker swarm framework.

This is my stack:

version: "3.7"

services:
  nextcloud:
    image: nextcloud:latest
    restart: unless-stopped
    volumes:
      - nextcloud-data:/var/www/html
    ports:
      - "84:80"   
    environment:
      TZ: America/Fortaleza
      POSTGRES_HOST: pgbouncer
      DB_PORT: 5432
      POSTGRES_DB: nextcloud
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: xxxxxxxxxxxxxx
      REDIS_HOST: redis
      REDIS_HOST_PORT: 6379
      REDIS_HOST_PASSWORD: xxxxxxxxxxxxxxxxxxxxx
      NEXTCLOUD_ADMIN_USER: xxxxxxxxxxxxxxx
      NEXTCLOUD_ADMIN_PASSWORD: xxxxxxxxxxxxxxxxx
      NEXTCLOUD_TRUSTED_DOMAINS: word.admin.test.com
      TRUSTED_PROXIES: 
      OVERWRITECLIURL: https://word.admin.test.com
      OVERWRITEPROTOCOL: https
      OVERWRITEHOST: word.admin.test.com
      APACHE_BODY_LIMIT: 1073741824
    networks:
      - network_public
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:80/"]
      interval: 10s
      timeout: 5s
      retries: 3
      start_period: 90s
    deploy:
      placement:
        constraints:
          - node.role == manager
      resources:
        limits:
          cpus: "1"
          memory: 1024M
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.nextcloud.entrypoints=web-secure"
      - "traefik.http.routers.nextcloud.rule=Host(`word.admin.test.com`)" # change hostname!
      - "traefik.http.routers.nextcloud.tls=true"
      - "traefik.http.routers.nextcloud.tls.certresolver=tlschallenge"
      - "traefik.http.routers.nextcloud.middlewares=secHeaders@file"
      - "traefik.http.services.nextcloud.loadbalancer.server.port=80" # set port the container listenes to

volumes:
  nextcloud-data:
    external: true
    name: nextcloud-data

networks:
  network_public:
    external: true
    name: network_public

Everything seems to work fine, the database is created in postgres, the tables are created.

When I access the site, I get this error:

image

I went to check the log, it tells me this, I’ve made all the possible changes and I can’t solve it.

[25/Jan/2024:20:19:03 -0300] "GET / HTTP/1.1" 302 1647 "-" "curl/7.88.1"[25/Jan/2024:20:19:03 -0300] "GET / HTTP/1.1" 302 1647 "-" "curl/7.88.1"

It seems that the system is redirecting the page, I went to the config.php file and the settings there are apparently all correct.

If anyone can help, thank you.

Port 84 in your case given the below is above this:

- "84:80"

Maybe?

1 Like

I’ve put it in every way:

  • “traefik.http.services.nextcloud.loadbalancer.server.port=80”
  • “traefik.http.services.nextcloud.loadbalancer.server.port=84”
  • “traefik.http.services.nextcloud.loadbalancer.server.port=84:80”

No resolution of the 404 error.

I’ve just registered the ServerName in the /etc/apache2/apache2.conf file.

Insert my domain.

It still doesn’t work.

All the necessary folders are in the HTML.

[25/Jan/2024:20:19:03 -0300] "GET / HTTP/1.1" 302 1647 "-" "curl/7.88.1"[25/Jan/2024:20:19:03 -0300] "GET / HTTP/1.1" 302 1647 "-" "curl/7.88.1"

Where is this log entry from? Traefik? Your Nextcloud Apache docker container?

This input comes from the container in the portainer.

What I can’t understand is that the database table is created normally.

Furthermore, all the files needed to run nextcloud are created in the http folder.

Seria interessante se alguém pudesse simular esse dockfile.

:d