502 Bad Gateway nginx - docker / swag

Bonsoir , je viens vers car après plusieurs heures de recherche je ne trouve pas se que je ne fais pas correctement
J’ai installer Nextcloud via docker

---
version: "2.1"
services:
  nextcloud:
    image: lscr.io/linuxserver/nextcloud:latest
    container_name: nextcloud
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Paris
    volumes:
      - /path/to/appdata-nextcloud:/config
      - /srv/***/nextcloud:/data
    ports:
      - 4433:443
    networks:
      - swag_default
    restart: unless-stopped

networks:
  swag_default:
    external: true

puis j’ai modifié le fichier .conf de swag

## Version 2023/05/10
# make sure that your nextcloud container is named nextcloud
# make sure that your dns has a cname set for nextcloud
# assuming this container is called "swag", edit your nextcloud container's config
# located at /config/www/nextcloud/config/config.php and add the following lines before the ");":
#  'trusted_proxies' => ['swag'],
#  'overwrite.cli.url' => 'https://nextcloud.example.com/',
#  'overwritehost' => 'nextcloud.example.com',
#  'overwriteprotocol' => 'https',
#
# Also don't forget to add your domain name to the trusted domains array. It should look somewhat like this:
#  array (
#    0 => '192.168.0.1:444', # This line may look different on your setup, don't modify it.
#    1 => 'nextcloud.example.com',
#  ),

server {
    listen 443 ssl;
    listen [::]:443 ssl;

    server_name nextcloud.*;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {
        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app nextcloud;
        set $upstream_port 4433;
        set $upstream_proto https;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

        # Uncomment X-Frame-Options directive in ssl.conf to pass security checks.
        proxy_hide_header X-Frame-Options;
        proxy_max_temp_file_size 2048m;
    }
}

Dans le log de nginx j’ai ça :
111: Connection refused) while connecting to upstream

Merci d’avance pour votre aide

1 Like

Où est votre entrée de composition swag docker ?

par exemple. linuxserver/swag - LinuxServer.io

De plus, il n’est pas nécessaire d’exposer les ports 4433:443 dans Docker ni de modifier $upstream_port 4433 dans le NGINX .conf

1 Like