¿Now in 2020 it is possible to integrate nginx with docker duck dns?

I’ve been researching various forums on configuring home assistants with nginx and duck dns but there is old information. The reason I want to use it is to be able to remotely communicate with my homeasisstant. Has anyone currently integrated nginx with homeasistant?

Yes I do, and probably 1000s of others do the same as well. What’s your issue exactly?

I am following this tutorial.

but I get to the part where I don’t know where this code goes

server {
listen 443 ssl;

    root /config/www;
    index index.html index.htm index.php;

    server_name hass.mydomain.duckdns.org;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    location / {

auth_basic “Restricted”;

auth_basic_user_file /config/nginx/.htpasswd;

            proxy_set_header Host $host;
            proxy_redirect http:// https://;
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_buffering               off;
            proxy_ssl_verify              off;

include /config/nginx/proxy.conf;

            proxy_pass http://10.10.10.211:8123;
    }

}

¿What documentation could help me configure nginx.? ¿Can this video help me currently?

Check out my guide.

Still valid

1 Like

I am currently confused at the moment, these are the files that must be configured and the one you mention in your post I cannot find it or you are using a different distribution than Debian.

This entire guide is based on using docker. Maybe I missed if you were using docker or something else?

The video is more than 1 year old and it is showing how to configure it in docker, so completely useless.

Do you have other things running on this machine or only HA?

I use this :

But with a portforward on 443.

Hi Juan, finally I was able to find the folders in which the nginx installation is explained. What was happening was that I had installed an nginx on my whole system and I did not remember it. Then I entered the path where I installed the linuxserve / letencript configuration and discovered that there was an nginx with the configuration you explain. I managed to install the portainer. I made the containers run and put the settings you put in but I don’t see homeasisstant working I don’t know what I’m doing wrong.



This is my setup. delete the parts that you had put in comments and change the port of fastcgi_pass hostip: 9000 to 9001 since portainer is occupying that port, I am only using a subdomain that is hass in if I just want at least one link to work and be able to communicate remotely.

PORT 80 ACTIVE

server {
listen 80;
server_name inteligente.duckdns.org;
return 301 https://$host$request_uri;
}

main server block

server {
listen 443 ssl default_server;

root /config/www;
index index.html index.htm index.php;

server_name inteligente.duckdns.org;

# enable subfolder method reverse proxy confs
include /config/nginx/proxy-confs/*.subfolder.conf;

# all ssl related config moved to ssl.conf
include /config/nginx/ssl.conf;

client_max_body_size 0;

location / {
	try_files $uri $uri/ /index.html /index.php?$args =404;
}

location ~ \.php$ {
	fastcgi_split_path_info ^(.+\.php)(/.+)$;
	# With php7-cgi alone:
	fastcgi_pass 193.169.2.5:9001;
	#fastcgi_pass 127.0.0.1:9001;
	# With php7-fpm:
	#fastcgi_pass unix:/var/run/php7-fpm.sock;
	fastcgi_index index.php;
	include /etc/nginx/fastcgi_params;
}

}

HOMEASSISTANT

server {
listen 443 ssl;

root /config/www;
index index.html index.htm index.php;

server_name hass.inteligente.duckdns.org;

include /config/nginx/ssl.conf;

client_max_body_size 0;

location / {

auth_basic “Restricted”;

auth_basic_user_file /config/nginx/.htpasswd;

	proxy_set_header Host $host;
	proxy_redirect http:// https://;
	proxy_http_version 1.1;
	proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
	proxy_set_header Upgrade $http_upgrade;
	proxy_set_header Connection "upgrade";
	proxy_buffering               off;
	proxy_ssl_verify              off;

include /config/nginx/proxy.conf;

	proxy_pass http://193.169.2.5:8123;
}

}

enable subdomain method reverse proxy confs

include /config/nginx/proxy-confs/*.subdomain.conf;

but in your portainer snapshot i see homeassistant running.
you should now go to hotsip:8123 and see it.
of from outside https://hass.inteligente.duckdns.org
remeber you need to port foward your router
so
outside port 443 to host:443
outside port 80 to host:81

Do I have to open my router ports for them to work? I’m at home, this should show me hass.mydomain.duckdns.org should no longer enter by miip: 8123 juan?

Well if you want to access from outside your network, yes you do
At home is http:// hostip:8123
Outside with port open
Https://…duckdns