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

    • OMV 4.x
    • 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.
    • 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 => '',
      4. 1 => ''
      5. ),
      6. 'trusted_proxies' => ['letsencrypt'],
      7. //'overwrite.cli.url' => '',
      8. 'overwrite.cli.url' => '',
      9. 'overwritehost' => '',
      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".
    • 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:, server:, request: "GET /favicon.ico HTTP/2.0", host: "", referrer: ""

      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;
      2. set $upstream_nextcloud;

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

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