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:



    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:


    Code
    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:

    Code
    set $upstream_nextcloud nextcloud;


    I also tried those with no success:


    Code
    set $upstream_nexcloud 192.168.0.111;
    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.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!