Penpot + Nginx issue, error 502

Hello,

I host Penpot on a Debian 12 VM, until then it worked fine.
Since I want to use Nginx in front of my Penpot instance, I can’t reach my website.
The frontend instance is in restart loop.

Here are my configuration files.

Penpot “docker-compose.yaml” file (just the “frontend” part):

penpot-frontend:
image: “penpotapp/frontend:latest”
restart: always
ports:
- 9001:80

volumes:
  - penpot_assets:/opt/data/assets

depends_on:
  - penpot-backend
  - penpot-exporter

networks:
  - penpot

labels:
  - "traefik.enable=true"


  - PENPOT_FLAGS=enable-registration enable-login-with-password

Nginx:
default “nginx.conf” file:

user www-data;
worker_processes auto;
pid /run/nginx.pid;
error_log /var/log/nginx/error.log;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

    ##
    # Basic Settings
    ##

    sendfile on;
    tcp_nopush on;
    types_hash_max_size 2048;
    server_tokens off;

    # server_names_hash_bucket_size 64;
    # server_name_in_redirect off;

    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    ##
    # SSL Settings
    ##

    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
    ssl_prefer_server_ciphers on;

    ##
    # Logging Settings
    ##

    access_log /var/log/nginx/access.log;

    ##
    # Gzip Settings
    ##

    gzip on;

    # gzip_vary on;
    # gzip_proxied any;
    # gzip_comp_level 6;
    # gzip_buffers 16 8k;
    # gzip_http_version 1.1;
    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

    ##
    # Virtual Host Configs
    ##

    include /etc/nginx/conf.d/*.conf;
    include /etc/nginx/sites-enabled/*;

}

So I created a specific config file for Penpot in “sites-available” (with ln to “sites-enabled” of course):
“penpot.conf”:

server {
listen 80;
server_name mydomainename.com ; # Here is an example, of course I’ve put the domain that correspond in my DNS configuration.

location /penpot {
    proxy_pass http://127.0.0.1:9001;  # here I tried with "localhost", same issue
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection 'upgrade';
    proxy_set_header Host $host;
    proxy_cache_bypass $http_upgrade;
}

}

Of course, all services has been reloaded. When I try to reach the Penpot app at : “http://mydomainname.com/penpot”
" 502 Bad Gateway" from my nginx.

Docker logs on the frontend instance :

/entrypoint.sh: line 26: /etc/nginx/nginx.conf.template: No such file or directory
/entrypoint.sh: line 28: exec: nginx: not found
/entrypoint.sh: line 26: /etc/nginx/nginx.conf.template: No such file or directory
/entrypoint.sh: line 28: exec: nginx: not found
/entrypoint.sh: line 26: /etc/nginx/nginx.conf.template: No such file or directory
/entrypoint.sh: line 28: exec: nginx: not found
/entrypoint.sh: line 26: /etc/nginx/nginx.conf.template: No such file or directory
/entrypoint.sh: line 28: exec: nginx: not found
/entrypoint.sh: line 26: /etc/nginx/nginx.conf.template: No such file or directory
/entrypoint.sh: line 28: exec: nginx: not found
/entrypoint.sh: line 26: /etc/nginx/nginx.conf.template: No such file or directory
/entrypoint.sh: line 28: exec: nginx: not found

I don’t understand why Penpot frontend is searching for this file “nginx.conf.template” from the entrypoint.sh.

Solved, a container named “penpot” alone started before the frontend. I deleted this container, works fine.