help with reverse proxy reddit / selfhosted ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 06:08 I for the life of me can not figure out how the hell to get this damn reverse proxy to work. I am trying to take a local ip (my portainer instance), [https://192.168.1.195:9443](https://192.168.1.195:9443) and make it so I can use homeserver.portainer as the address instead. I have adguard home, I have nginx, but I do not know how to add the right thing into adguard so it works with nginx. My nginx config in /etc/nginx/sites-available looks like this: server{ listen 81; server\_name homeserver.portainer; location / { proxy\_pass "[https://192.168.1.195:9443](https://192.168.1.195:9443)"; } } ​ The ip for the nginx container is [192.168.1.199](https://192.168.1.199), and adguard home is on [192.168.1.195](https://192.168.1.195) but I do not know how to get nginx to communicate with it. If I put in [192.168.1.199](https://192.168.1.199), it takes me to portainer but I do not want that. As I said, I want it to route through homeserver.portainer. And I can't find any coherent guide anywhere or a proper answer on reddit. It's always an answer like, "put this thing there and then go put it there" like how tf is that gonna be helpful to anybody. Tell me exactly how to do it and where to go, please and thank you. (I am braindead when it comes to this stuff, so you gotta hold my hand, im a beginner) Also, do I have to add the adguard ip to my dns settings in windows in order for all this to work as well? Or is that just for blocking the ads and stuff? ​ ​ ---------------------------------------------------------------------- thekrautboy · 2023-11-08 06:25 Why not ask /r/Adguard? ---------------------------------------------------------------------- Plane_Resolution7133 · 2023-11-08 06:34 How did you set up your local DNS to resolve *homeserver.portainer*? ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 06:40 I guess that's what I asking, how do I do that? If by resolve you mean it points to the portainer IP address then yes that's what I don't know how to do. ---------------------------------------------------------------------- dazchad · 2023-11-08 06:45 What you are looking for is a DNS resolver. You can add entries to your local hosts file, but ideally you’d have a DNS resolver doing that for you so all devices in your network will see it. Also be advised that you will have a hard time generating a https certificate with this fake tld. Some routers offer this custom dns entry feature, but I’d personally go with pihole since it will also block other crap. ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 06:46 Yeah I found this tutorial which uses pi hole but I've already had adguard set up so I wanted to use it. https://youtu.be/QcnAqN_Ihqk?si=sB2iC7usTW1qpXSg It's that last step at the end where he edits the dns file for pi hole. That's kind of where I'm stuck ---------------------------------------------------------------------- root_switch · 2023-11-08 06:57 First off you don’t need a reverse proxy to use hostnames for your containers, you just need a dns server with a record that points your “homeserver.portainer” to the IP of your docker host that’s hosting your portainer container. Meaning that within adguard or whatever is your dns server, you need to have a CNAME DNS entry that points “homeserver.portainer” to your IP. Second, I’d avoid using “homeserver.portainer” as there is potential for this to be resolvable, you should be using local internal domains only such as `.local` or `.home.arpa`. ---------------------------------------------------------------------- Plane_Resolution7133 · 2023-11-08 07:01 Do you have your computer(s) set up with static or dynamic IP? I don’t know Adguard, but if it is a DNS server, you’ll need to configure your computer(s) to use that as your DNS server, or configure your DHCP server to point to that DNS server. DNS file for pi hole could just be entries like *10.10.10.10 host host.name*. ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 07:20 I think I found it in adguard home. It's in dns settings, upstream dns. I tried to follow what the guide had there but I go to the local address and it still doesn't work. Might just give up ---------------------------------------------------------------------- ScottishCrafter · 2023-11-08 15:27 I think the options you're looking for are in Filters > DNS Rewrites Click "Add DNS Rewrite" and fill in your domain and the local IP address of your proxy. ---------------------------------------------------------------------- dazchad · 2023-11-08 16:22 I'm not familiar with adguard, but try to look for DNS settings. But quite frankly, I'd rather buy a real domain and use it instead. Much easier in the long run. ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 17:47 I was trying to do this on my mock setup on my laptop but even this was unsuccessful. Perhaps it's something weird with running adguard in Ubuntu in a vm. I have to use the IP of adguard as my dns server in order for it to work right? I'll try when I get home on the main server. ---------------------------------------------------------------------- ScottishCrafter · 2023-11-08 19:09 > I have to use the IP of adguard as my dns server in order for it to work right? Correct. ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 19:22 yeah it still isnt working, honestly gonna give up ---------------------------------------------------------------------- TheShadowGamer06 · 2023-11-08 19:47 update: I fixed it by disabling ipv6 in my windows network control panel properties. now I need to figure out how to redirect to certain ports, i think thats where nginx comes in? ---------------------------------------------------------------------- ScottishCrafter · 2023-11-08 19:50 Yes. It will proxy the connection to the correct port when set-up correctly.