[SOLVED] Nexcloud not reachable - 502 Bad Gateway

  • Hi to all,


    Following the guide linked below, I setup my NextCloud with Swag as the subdomain https://nextcloud.mydns.it/

    [How-To] Nextcloud with Letsencrypt using OMV and docker-compose


    Unfortunately, I can't access because I obtain alway the "502 Bad Gateway" error.


    Here is my configuration, I hope someone can help me...

    • Docker for Nextcloud, MariaDB and Swag (reverse proxy)
    • DNS CloudFlare


    A) NextCloud (docker)


    B) Swag (docker)


    C) DNS (Cloudflare)

    TypeNameContentTTLProxy status
    Amydns.it123.456.789.012AutoDNS only
    CNAMEnextcloudmydns.itAutoDNS only




    D) NextCloud configuration file <config.php>


    E) NextCloud subdomain configuration <nextcloud.subdomain.conf>



    Really thank you all in advance.

  • Your post suggests that you use different docker-compose.yml files for swag and Nextcloud. This won’t work because the guide relies on the fact that container in a joined docker-compose file will be added in a docker network, which is required for docker internal dns resolution.


    Does the swag container get the certs?


    Line 23 under swag is optional? I don't think that

    It’s only necessary to expose port 80 of the swag container if using validation=http

    • Offizieller Beitrag

    Your post suggests that you use different docker-compose.yml files for swag and Nextcloud. This won’t work because the guide relies on the fact that container in a joined docker-compose file will be added in a docker network, which is required for docker internal dns resolution.


    Does the swag container get the certs?


    It’s only necessary to expose port 80 of the swag container if using validation=http

    Hmm, did not know that.


    What he said above about the two compose/stack files makes sense. You could just deploy the first two, then add the swag container onto the end of the compose/stack, and redeploy

    • Offizieller Beitrag

    Following the guide linked below

    Would be easier if you would really follow the guide. That includes putting all container in one docker-compose file and not two as well as the ports mentioned by KM0201.


    If you setup the container separately, you must make sure they are on the same docker network, so that they can talk to each other.

  • Your post suggests that you use different docker-compose.yml files for swag and Nextcloud. This won’t work because the guide relies on the fact that container in a joined docker-compose file will be added in a docker network, which is required for docker internal dns resolution.

    Yeah, you're right.

    Moving swag inside the Nextcloud stack, finally I can reach it.

    Do I have to move also MariaDB inside it or can I keep it outside?


    Then... I used swag in a different stack because I'd like to enable more subdomains for other containers (eg. Heimdall).

    Do I have to move all of them inside the same compose file or not?

    • Offizieller Beitrag

    You can manually set their networks in Portainer, if you're using it.

  • mbinax

    Hat das Label gelöst hinzugefügt.
  • mbinax

    Hat den Titel des Themas von „Nexcloud not reachable - 502 Bad Gateway“ zu „[SOLVED] Nexcloud not reachable - 502 Bad Gateway“ geändert.
  • Not quite sure how the

    502 Bad Gateway

    nginx


    issue got resolved... still struggling with this at my end. swag seems to be working as I have a 'locked' icon in my browser, but I can't connect to OMV/Docker/NextCloud app...

  • Not quite sure how the

    502 Bad Gateway

    nginx


    issue got resolved... still struggling with this at my end. swag seems to be working as I have a 'locked' icon in my browser, but I can't connect to OMV/Docker/NextCloud app...

    You need to provide more INFO than just saying it doesn't work.


    What is it that you want to do?

  • I'm trying to run NextCloud (Docker container) on a Raspberry Pi 4B, 64-bot, 8GB RAM) running Open Media Vault 6, over an encrypted https connection. I'm getting that above error (B504 - Bad gateway nginx when typing https://my.domain.name.com/nextcloud/ (not my actual domain name) on a browser (both Windows PC and iPhone).


    I'm using DynuDNS as my DDNS provider, have for some time, no issues there. NextCloud was working fine with http access before I converted the setup to run https. For http access (internal network only) I was using port 8080 off my internal Raspberry Pi IP address (192.168.1.25:8080) at the time with no issues.


    After adding swag, no such luck; am getting a locked icon on my https://domain.name/nextcloud (, a bit reluctant to provide it here) so I assume swag is working.


    I have to admit that I'm getting somewhat confused with port mappings and what absolutely needs what port to work on. OMV itself I have running on port 82 (192.168.1.25:82).


    Any help/comments appreciated.

    Ray



    Docker-compose yml file (some fields redacted with xxx's, and my actual domain name replaced with my.domain.com)


    NextCloud configuration file </SSD/appdata/nextcloud/config/config.php>

    NextCloud subfolderconfiguration </SSD/appdata/swag/nginx/proxy-confs/nextcloud.subfolder.conf>


    Have this on my router as well to complete the picture.

  • First off, you're using the YML from Nextcloud and you just added the SWAG service to it.

    This is NOT supported on the forum.


    Here we use the one's on the Guides section: one from macom and the other from KM0201


    All that follows might, might not work.

    Accept it or start fresh with one of the guides from here.


    Docker-compose yml file (some fields redacted with xxx's, and my actual domain name replaced with my.domain.com)

    You don't have a port open for the Nextcloud service.

    SWAG can't access it.


    Your YML should be like this:


    Save and redeploy the YML.


    Edit your config.php line #25 from this 0 => '192.168.1.25:443',

    to this 0 => 'https://192.168.1.25:450',


    Delete line #42 from it.


    Restart swag and nextcloud and see if you can reach it from WAN.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!