Help request for Reverse proxy setup with HTTPS to build a server for multiple services Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by LeVraiRoiDHyrule »

Hi again,

Sorry for the false error, it's just me that messed things up.

Docker + Portainer are now installed, yay !
Now, I would need some help to create a new container to install Nginx Proxy Manager.

Here is the content of the docker-compose.yml from the website :



version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
ports:
- '80:80'
- '81:81'
- '443:443'
environment:
DB_MYSQL_HOST: "db"
DB_MYSQL_PORT: 3306
DB_MYSQL_USER: "npm"
DB_MYSQL_PASSWORD: "npm"
DB_MYSQL_NAME: "npm"
volumes:
- ./data:/data
- ./letsencrypt:/etc/letsencrypt
db:
image: 'jc21/mariadb-aria:10.4'
environment:
MYSQL_ROOT_PASSWORD: 'npm'
MYSQL_DATABASE: 'npm'
MYSQL_USER: 'npm'
MYSQL_PASSWORD: 'npm'
volumes:
- ./data/mysql:/var/lib/mysql


I'm now in front of my Portainer admin page, and I have approximately the same settings as the content of this file.

Is there a way to directly import this file into Portainer, to be sure to avoid any misconfiguration ?
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by LeVraiRoiDHyrule »

Hi again,

I found how to directly import a docker-compose file into Portainer, using the Stacks tab.

But the issue is that portainer supports only up to docker-compose v2 files, and my file is v3. So I have an error.
What would be the solution to this ?
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by Joulinar »

use following to get your stack created using portainer

https://github.com/MichaIng/DietPi/issu ... -756783571
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by LeVraiRoiDHyrule »

Hi again,

I just misunderstood a message in the cli, sorry.

Portainer + Docker are now correctly installed.

But I have an issue that I didn't manage to solve : Nginx Proxy Manager uses docker-compose.yml version 3, but Portainer only supports up to version 2.

Did you already encountered that kind of issues ?
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by Joulinar »

I'm going to copy myself from the post above
Joulinar wrote: Sat Feb 06, 2021 10:22 pm use following to get your stack created using portainer

https://github.com/MichaIng/DietPi/issu ... -756783571
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by LeVraiRoiDHyrule »

Hi again,

I'm having a new issue.

I succeeded 1 time to install Portainer + Docker. I had to reformat my SD card, now I would like to install it again.
But I can't manage to install it again. I don't understand why it worked the first time, but I'm raning into the same issue I had before.

It looks like the Pi reboots itself during the Portainer installation, so it doesn't finalize it.
My Pi is a fresh Dietpi install. I am just trying to install portainer, and the Pi inexplicably reboots at this point of the installation :


DietPi-Software
─────────────────────────────────────────────────────
Mode: Configuring Portainer: Simplifies container management in Docker (standalone host)

[ INFO ] DietPi-Software | Docker will be restarted to be able to deploy the container.
[ OK ] DietPi-Software | systemctl daemon-reload
[ OK ] DietPi-Software | systemctl restart docker
[ OK ] DietPi-Software | docker volume create portainer_data
[ INFO ] DietPi-Software | Portainer will be deployed now. This could take a while...
[ INFO ] DietPi-Software | docker run -d -p 9002:9000 --name=portainer --restart=always -v /run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce, please wait...
Unable to find image 'portainer/portainer-ce:latest' locally
latest: Pulling from portainer/portainer-ce
94cfa856b2b1: Pulling fs layer
49d59ee0881a: Pulling fs layer
5cc18cc44bf4: Pulling fs layer
49d59ee0881a: Verifying Checksum
49d59ee0881a: Download complete
94cfa856b2b1: Verifying Checksum
94cfa856b2b1: Download complete
94cfa856b2b1: Pull complete
49d59ee0881a: Pull complete
5cc18cc44bf4: Verifying Checksum
5cc18cc44bf4: Download complete

*The pi reboots at this point*

If I re-try installing Portainer, it will always reboot at this point and Portainer is not installed.
I tried with installing Docker only first, then Portainer, or Portainer only that should include Docker, I always have this issue.

I absolutely don't understand why it worked the first time and how I can't manage to make it work again. There is always issues during Portainer installation from dietpi-software.

Do you have an idea about what could be causing this ?

Thanks in advance for your answer and have a good day
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by Joulinar »

strange that you system is doing a reboot out of the box. I hope there are no other issues like low voltage. Did you tried using a different SD card?

Anyway you could try installing portainer yourself

Code: Select all

docker run -d -p 9002:9000 --name=portainer --restart=always -v /run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by LeVraiRoiDHyrule »

You were perfectly right. Undervolting was the issue. I wasn't using the official power supply and I applied a +2V overclocking profile. That was causing the random reboots during Docker installation. I am now using the official power supply and the default overclocking profile. I will only apply my overclocking at the end when everything will be set up.

Thank you for having pointed that possible issue.

I started all over, and now I have Docker + Portainer + Nginx Proxy Manager installed from the stack tabs using your docker-compose file. Thanks a lot for this again.

I have correctly set up my admin account on NPM, and my Jellyfin is correctly set up.

I am now (finally) ready for the real reverse proxy configuration.

I'm on this page :

Image

Jellyfin is usually using HTTP port 8096 to communicate. I would like to secure all that behind my proxy with an SSL certificate.

Jellyfin official docs provide these configs : https://jellyfin.org/docs/general/networking/nginx.html
But they provide an exemple for no subpath but with SSL, and an example with SSL but no subpath. I would like Subpath + SSL and I don't know how to adapt these config files to fit my needs. Could you help me on this, if you have some time ?

Thanks in advance for any answer and have a great day
Last edited by LeVraiRoiDHyrule on Sun Feb 07, 2021 4:38 pm, edited 1 time in total.
User avatar
Joulinar
Posts: 4804
Joined: Sat Nov 16, 2019 12:49 am

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by Joulinar »

just simply add your Jellyfin server information. It's fine to stay with HTTP because SSL is done between internet and the proxy manager. HTTP is done inside your local network only.

Personally I don't use this tool as I don't have something exposed to the web. It might be good to check some guides or YouTube tutorials on the web, showing how to configure the proxy manager correctly. It's quite a powerful tool with plenty of options.
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
LeVraiRoiDHyrule
Posts: 55
Joined: Tue Apr 28, 2020 3:00 pm

Re: Help request for Reverse proxy setup with HTTPS to build a server for multiple services

Post by LeVraiRoiDHyrule »

Thanks for your explanation about HTTP inside the server itself.

The problem is that I don't know how to read the infos from https://jellyfin.org/docs/general/networking/nginx.html , to adapt them into Nginx Manager. An issue is that they provide examples for no subpath with SSL, and subpath but without SSL. I'm searching to have subpath AND SSL. Both configuration files provide additionnals informations that the other don't have.

Here is all the setting pages of NPM : https://imgur.com/a/1fLdBdZ

I tried filling it that way :

Image
Image
Image
Image

And I've also requested correctly a new SSL certificate.

But with these settings, my host is not online and I can't access it from outside my network.

I don't want to ask too much but could you help me to find what is incorrect in my settings ?

Thanks again for your help and have great day.
Post Reply