tobychui / zoraxy

A general purpose HTTP reverse proxy and forwarding tool. Now written in Go!
https://zoraxy.aroz.org
GNU Affero General Public License v3.0
2.87k stars 170 forks source link

[HELP] How to use private IP range in access rule? #334

Open Lexxior opened 18 hours ago

Lexxior commented 18 hours ago

What happened? I can't access my domains from my LAN when adding my subnet (192.168.1.0/24) to the access rule, it works only with my public IP, which is dynamic and changes regularly.

Describe what have you tried Changing the config according to tips from existing issues

Describe the networking setup you are using docker, latest version

I need help to configure my network so I can access the domains from within my LAN

Orko79 commented 4 hours ago

Hi! To make this work, you need to point your local services to your zoraxy ip via a local DNS service. This can be done with services like pihole, adguard and similar. Here is an example from my pihole: grafik These are the local IPv4 and IPv6 of my zoraxy instance. If you don´t set up a local DNS service, you will always access your local services with your external IP, because you are using a public DNS provider. These can´t resolve IPs in local networks. This can only be done via a local DNS service, as mentioned before. You could also edit your hosts file, but then you need to do this on every device. It´s a mess to keep this clean and it´s not easy to do on mobile devices.

tobychui commented 4 hours ago

@Lexxior This happens because your domain is resolved to your public IP address and when you are connecting to it (via your web browser, for example), your computer is actually requesting your public IP address. From Zoraxy perspective, you are accessing from WAN using your own public IP address of your router (if you are hosting your setup at home).

The proper fix is following @Orko79 recommendation and setup your DNS service correctly or just whitelist your own public IP address in the access rule.