metbril
(Robert 🇳🇱🇪🇺)
February 21, 2018, 5:55am
1
I have created a ‘plain vanilla’ Docker (test) setup of Home Assistant on my Raspberry Pi 3 and like to place a reverse proxy to access HA from outside.
I have installed a HA docker and the rpi-nginx-proxy container.
I can access HA internally over http://192.168.x.x:8123 . When I open http://my.duckdns.org I get to see the default Nginx “welcome” page. So nginx is running, but not proxying.
router outside port 80 is forwarded to RPi port 80
duckdns domain is active for my IP: my.duckdns.org
In the end I also will install Let’s Encrypt certificates and only open port 443 to the outside world
This is the install:
$ docker pull homeassistant/raspberrypi3-homeassistant
$ docker pull lroguet/rpi-nginx-proxy
$ docker run -d -p 80:80 -v /var/run/docker.sock:/tmp/docker.sock:ro --name nginx-proxy lroguet/rpi-nginx-proxy
$ docker run -d -i --name home-assistant --restart=always --net=host --expose 8123 -e VIRTUAL_PORT=8123-e VIRTUAL_HOST=my.duckdns.org -v /etc/homeassistant/config:/config homeassistant/raspberrypi3-homeassistant
How can I get the proxy to work? Any suggestions?
m0wlheld
(Christoph Dahlen)
February 21, 2018, 12:24pm
2
Is that your own nginx-image with an appropriate configuration embedded or a public image (which I cannot find on dockerhub)?
I see nowhere that you have configured a reverse proxy.
metbril
(Robert 🇳🇱🇪🇺)
February 21, 2018, 12:58pm
4
lroguet/rpi-nginx-proxy is a copy of jwilder/nginx-proxy that should be working on a rpi. What I read is that this container should automatically take care of reverse proxying any exposed ports. More information in Automated Nginx Reverse Proxy for Docker .
Since I am a Docker novice, I can’t get it to work without help from the Community.
Wouldn’t it just be easier to configure your NGINX reverse proxy instead of relying on some magic voodoo that probably doesn’t work with Home Assistant configuration needs?
metbril
(Robert 🇳🇱🇪🇺)
February 21, 2018, 1:32pm
6
I guess it would. Since I really like the easy of Docker (an like to learn) I think I would need some plain vanilla nginx-proxy container that works on a rpi, and provide the configuration via a volume mapping?
Do you know of such an image?
you just need nginx, you don’t need some special nginx-proxy.
metbril
(Robert 🇳🇱🇪🇺)
February 21, 2018, 1:49pm
9
Would the official image work with Raspberry Pi: https://hub.docker.com/_/nginx/
or should I use some specific one like https://hub.docker.com/r/tobi312/rpi-nginx/
Can’t find any reference on this forum, unfortunately.
Official one should work:
Click here (in docker hub):
Supported architectures: (more info)
amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le, s390x
-> takes you here:
metbril
(Robert 🇳🇱🇪🇺)
February 21, 2018, 2:26pm
11
So for Raspberry Pi 3 that would mean arm64v8
and thus docker pull arm64v8/nginx
from https://hub.docker.com/r/arm64v8/nginx/ ?
I might be mistaken but I think it is v7. It is easy to try it out. Or somebody who tested it on RPi should answer.
m0wlheld
(Christoph Dahlen)
February 22, 2018, 7:16am
13
Official image without any tags will work. Right binary format is automatically chosen (for nginx). So
docker run -d -p 80:80 -v /etc/timezone:/etc/timezone:ro -v $PWD/my-nginx-proxy.conf:/etc/nginx/nginx.conf --name nginx-proxy nginx
with an appropriate configuration in “my-nginx-proxy.conf” should work.
nicx
February 22, 2018, 12:19pm
14
I think you need to set the nginx proxy option as described here: https://home-assistant.io/docs/ecosystem/synology/