Default "Success" page always loads instead of my app

Hi, I am sorry for a very noob question but I just cannot figure it out.

I use Hestia for some time and I’m super happy with it, works great for my needs.
It runs on Ubuntu server where I also have Docker with Portainer. When I deploy any container, let’s say BookStack, the container runs but I cannot access the app because Hestia’s “Success” page loads instead. The subdomain bookstack.mydomain.com is not added in Hestia at all.
When using portainer, it does not load with default portainer.mydomain.com but using with :9443, it works.

This is how the container looks like:

CONTAINER ID   IMAGE                                     COMMAND                  CREATED         STATUS         PORTS                                                                                                                                                                 NAMES
7b7a653e4f7c   lscr.io/linuxserver/bookstack             "/init"                  5 minutes ago   Up 5 minutes   443/tcp, 0.0.0.0:6875->80/tcp, :::6875->80/tcp                                                                                                                        bookstack
5c495c29bcfd   lscr.io/linuxserver/mariadb               "/init"                  5 minutes ago   Up 5 minutes   3306/tcp                                                                                                                                                              bookstack_db

Assuming this has something to do with nginx?
When I check that I see many entries like this:

nginx: [emerg] bind() to <IP>:80 failed (98: Address already in use)
nginx: [emerg] bind() to <IP>:443 failed (98: Address already in use)

Would you please point me into the right direction how to make apps work (installed in docker or not)?

Many thanks!

You need to create custom templates that reverse proxy to your application.

Thank you. I created custom templates for both nginx and apache but they are not showing up in HestiaCP, only “default”.

templates created are here:

/usr/local/hestia/data/templates/web/nginx/custom/bookstack.tpl
/usr/local/hestia/data/templates/web/nginx/custom/bookstack.stpl

/usr/local/hestia/data/templates/web/apache2/custom/bookstack.tpl
/usr/local/hestia/data/templates/web/apache2/custom/bookstack.stpl

restarted hestia, nginx and apache and still no custom config is available for the domain (in Advanced options)…

then I also tried to create

/home/USERNAME/conf/web/portainer.hx7.eu/web.conf

but no change … :expressionless:

what am i doing wrong?

Use /usr/local/hestia/data/templates/web/nginx/ as path instead

Right, thanks.
I changed the location as suggested and now I am able to apply the custom template.
But I am getting: Client sent an HTTP request to an HTTPS server.

The config files look like this:

/usr/local/hestia/data/templates/web/nginx/bookstack.tpl

server {
    listen      <IP>:80;
    server_name bookstack.mydomain.com;

    return 301 https://$host$request_uri;
}

and

/usr/local/hestia/data/templates/web/nginx/bookstack.stpl

server {
        listen <IP>:443 ssl;
        http2 on;

    server_name bookstack.mydomain.com;

    ssl_certificate      /home/<USER>/conf/web/bookstack.mydomain.com/ssl/bookstack.mydomain.com.pem;
    ssl_certificate_key  /home/<USER>/conf/web/bookstack.mydomain.com/ssl/bookstack.mydomain.com.key;
    ssl_protocols TLSv1.2 TLSv1.3;
    ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256';
    ssl_prefer_server_ciphers off;

    location / {
        proxy_pass http://127.0.0.1:9443;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Replace:
proxy_pass http://127.0.0.1:9443;

with
proxy_pass https://127.0.0.1:9443;

It worked! Wow, many thanks!!!