How to use both NGINX and Adguard Home?

Hello, i have an HA instance configured with DuckDNS and i am able to reach it from outside (with a port forwarded)

I also use Adguard Home and wanted to try NGINX so i could disable that port forwarding, the problem is they are conflicting, as both work on port 443

Any idea on how to solve this problem?

You’ll need to forward 443 to NGINX, and then have that send the appropriate traffic to DuckDNS (i.e. traffic looking for your DuckDNS subdomain). Note however, I don’t think DuckDNS will be a scalable solution with NGINX, as you only get one subdomain.

Typically, a reverse proxy is forwarded traffic entering your network on ports 80 (http) and 443 (https) and decides wha to do with it. For example, if someone accesses https://sub.domain.com your router recieves a request of port 443 which it is forwarded to the reverse proxy, which knows what server that is and sends the traffic there. It could be another web server entirely (192.168.15.23:443) or a service on the same server using a different port (i.e. 10.0.4.3:2343). It depends on how you have your servers setup.

With a Reverse Proxy, you can have multiple sub-domains. For example, https://www.domain.com could go to a web server at 192.168.0.2:443 and https://ftp.domain.com could go to an FTP site at 192.168.0.3:1000. But with only one subdomain through DuckDNS, you can only redirect to one server.

Thanks for the reply

I think one DNS is enough, I just need access through HTTPS

Should I install NGINX or NGINX Proxy Manager?

EDIT: Tried with NGINX but I get a Bad Gateway error

NGINX is a full web server capable of many things, including acting as a reverse proxy. NGINX Proxy Manager (NPM) is a version of NGINX configured to be a user-friendly implementation of NGINX’s reverse proxy features. NPM will be easier to setup, but lacks some of the configuration options of NGINX.

Thanks everyone

I was able to set up NGINX with DuckDNS, local access works, url access works, but i noticed i’m unable to access from outside my network, what could be causing the issue?

I have both ports 443 and 8123 forwarded

With nginx as a reverse proxy you don’t need to open port 8123, it takes care of it for you on port 443. You need to show the configuration if you want any help on this. Redact the domain name.

This is my config, i can connect via iOS with WIFI, as soon as i start using data it stops working

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24
  ip_ban_enabled: true
  login_attempts_threshold: 3

nginx config too please.

I am using NGINX Home Assistant SSL proxy, i only changed the address adding DuckDNS

Ah sorry, I missed that. I use a standalone nginx so not touched the add-on. There’s a guide here, see if that helps. NGINX Home Assistant SSL Proxy setup

THANK YOU!

Seems like the issue was port 443, changing it to something different fixed the issue, seems like my ISP was blocking that

I love you so much