After configuration nginx revers Proxy no acces to nextcloud (502 Bad Gateway)

    • OMV 4.x

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • After configuration nginx revers Proxy no acces to nextcloud (502 Bad Gateway)

      Hi there,

      I am just trying to sercure my Nextcloud and get acces from external.

      I setup Nextcloud in docker with the How To Video of TechnoDadLife at the first step.
      Then tried to get it worked with the second Video HowTo of TDL >

      But at the end I can`t access Nextcloud. Not from external and not from internal anymore.


      502 Bad Gateway


      Portforwarding ist working.
      I get the Letsencrypt Cirtificate in my Browser and can see my SubDomain.


      Does someone have an idea how I can troubleshoot this error? ?(

      Many thanks in advanced.

      Answers in german or russian would be fine too.
    • New

      I have the same issue.

      1. I updated and renamed "nextcloud.subdomain.conf.sample" - As a result the traffic is correctly forwarded to the Nextcloud docker.
      2. I updated "nextcloud/config/config.php" to trust my domain, added "trusted_proxies" and do the host/protocol overwriting:

      PHP Source Code

      1. 'trusted_domains' =>
      2. array (
      3. 0 => '192.168.0.111:444',
      4. 1 => 'get.acme.net'
      5. ),
      6. 'trusted_proxies' => ['letsencrypt'],
      7. //'overwrite.cli.url' => 'https://192.168.0.111:444',
      8. 'overwrite.cli.url' => 'https://get.acme.net',
      9. 'overwritehost' => 'get.acme.net',
      10. 'overwriteprotocol' => 'https',
      Display All


      3. Now I had access-logs in the Nextcloud Nginx Log directory. But the browser screen always says "Bad Gateway".
    • New

      After re-checking the nginx error.log I see:

      Source Code

      1. 2019/07/11 15:11:42 [error] 369#369: *5 nextcloud could not be resolved (3: Host not found), client: 192.168.0.1, server: get.acme.net, request: "GET /favicon.ico HTTP/2.0", host: "get.acme.net", referrer: "https://get.acme.net/"




      which relates to this line in the letsencrypt proxy configuration:

      Source Code

      1. set $upstream_nextcloud nextcloud;


      I also tried those with no success:

      Source Code

      1. set $upstream_nexcloud 192.168.0.111;
      2. set $upstream_nextcloud get.acme.net;

      The latter even seems to create a loop in the server ("*762 768 worker_connections are not enough while connecting to upstream, client: 192.168.0.1,").


      Why can the "nextcloud" variable not be found? I guess it's the name of the docker image, which should be there.