Can't make app VPN protection work
-
Extension: Supporting Inbound Proxies (Xray / 3X-UI) to access VPN protected apps
If you are running an inbound proxy server (like Xray via a 3X-UI panel) that connects to your OpenWrt router (e.g., as a client on an inbound wgserver tunnel like 10.4.0.3), Xray will naturally try to use its own application-layer routing and public DNS. This bypasses the router's PBR engine and triggers the "VPN connection required" block. To fix this, you must instruct Xray to natively map your Cloudron domains directly to the internal CGNAT/Docker IP address that your router's PBR engine is already intercepting.
Step 1: Update the Xray DNS Config Template (3X-UI)
- Log into your 3X-UI panel and confirm DNS is enabled (Xray Configs -> DNS tab)
- Navigate to Xray Configs -> Advanced tab (or your core JSON configuration template).
- Locate the "dns" configuration block.
- Manually add a "hosts" mapping block right above your "servers" array, explicitly binding your app domains to the routed internal Cloudron IP (100.64.0.1):
"dns": { "hosts": { "my-app.domain.net": "100.64.0.1", "my-other-app.domain.net": "100.64.0.1" }, "servers": [ { "address": "localhost", "port": 53, "skipFallback": true }, { "address": "1.1.1.1", "port": 53, "skipFallback": false } ], "queryStrategy": "UseIPv4", "tag": "dns_inbound" }- Click Save/Update Config and Restart Xray Service.
Step 2: Ensure Router PBR Policy is Set to Catch-All
On your OpenWrt router, make sure your policy rule seamlessly captures this traffic, regardless of whether it originates from a local LAN machine or your proxy's inbound tunnel interface IP (10.4.0.3).
- Open VPN Policy Routing screen.
- Verify or create a rule matching this exact profile:
• Local Addresses / Devices: Leave completely blank (This creates a global catch-all rule for all local and tunnel interfaces).
• Remote addresses / domains: 100.64.0.1
• Interface: Select your outbound Cloudron WireGuard interface (wg_cloudron). - Click Save & Apply.
-
@nebulon Thanks for getting back to me yet again. Nothing custom, I do use DoT on my OpenWRT router, but that's all.
With that said, after many hours of debugging and trying many different configurations, I seem to finally be able to access VPN protected apps without any hacks. Took me a while to discover 100.64.* subnet along with other things.
The issue occurs because Cloudron’s per-app VPN protection verifies access by evaluating the client's source IP at the Nginx reverse-proxy level, which breaks when a central network router acts as a gateway and enforces NAT masquerading (Double-NAT).
The solution that worked for me is to implement Split-Horizon DNS at the router level, forwarding the app's domain queries directly to Cloudron’s internal VPN DNS relay (seems to be 10.9.0.1 in my case), which allows traffic to ingress securely via the native WireGuard network interface layer without tampering with the original client packet structure. To make this work seamlessly, users must also ensure individual client devices do not bypass the router's DNS via encrypted Secure DNS features (DNS-over-HTTPS).
Below I'll share the steps required to setup a router so that multiple devices are able to access these protected apps without needing to have VPN connection on each.
One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).
One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).
Well, someone requested it ^^. If I remember correctly ++
-
B bazinga has marked this topic as solved
-
Not everyone is on a fixed IP all the time (residential addresses, mobile networks, etc.)
… but why not both? Open a request

-
Not everyone is on a fixed IP all the time (residential addresses, mobile networks, etc.)
… but why not both? Open a request

@necrevistonnezr "Not everyone is on a fixed IP" -> hence the "domain" part of my question. Dynamic dns does wonders. And if anyone wants to protect their traffic on open WiFi, then VPN'ing to your actual home/office/whatever, which in turn has its IP whitelisted, makes way more sense to me.
-
@nebulon Thanks for getting back to me yet again. Nothing custom, I do use DoT on my OpenWRT router, but that's all.
With that said, after many hours of debugging and trying many different configurations, I seem to finally be able to access VPN protected apps without any hacks. Took me a while to discover 100.64.* subnet along with other things.
The issue occurs because Cloudron’s per-app VPN protection verifies access by evaluating the client's source IP at the Nginx reverse-proxy level, which breaks when a central network router acts as a gateway and enforces NAT masquerading (Double-NAT).
The solution that worked for me is to implement Split-Horizon DNS at the router level, forwarding the app's domain queries directly to Cloudron’s internal VPN DNS relay (seems to be 10.9.0.1 in my case), which allows traffic to ingress securely via the native WireGuard network interface layer without tampering with the original client packet structure. To make this work seamlessly, users must also ensure individual client devices do not bypass the router's DNS via encrypted Secure DNS features (DNS-over-HTTPS).
Below I'll share the steps required to setup a router so that multiple devices are able to access these protected apps without needing to have VPN connection on each.
One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).
One question: why did you guys opt for this VPN protection vs simply allowing users to define a white list of source IPs or domains from where the access would be allowed? Would be much simpler and not require the VPN hassle (no matter on an endpoint or a router).
I tried to use Blocked IPs & ranges feature adding all IP’s list unless the specified IP but VPS became unresponsive.
I agree to enable an allow list that, when enabled, blocks everything unless specific IP.
-
-
I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.
I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.
Vurrent VPN system is perfect and gives a certain level of granularity.
-
I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.
@girish sounds like both options could be useful.
eg if there was a simple way to simply whitelist my own ip and block everything else, that probably would've been easier and quicker than setting up VPN access for dozens of apps (not that I did that, I just stopped all php apps).
Might've been useful when restarting the apps to update them too?
-
I think if we do a simple IP whitelist/blocklist, the onus is on the Cloudron admin to manage all this. Users come and go, move between places, have dynamic IPs etc. But sure, this can be added to, if it's seen as beneficial over VPN.
@girish If someone wants very complex setup - sure, they can opt for the VPN solution (even though I don't see that as a simple setup either). But whitelisting home / office IPs is very easy. Dynamic IPs are covered by dynamic dns.
VPN protection for bunch of users means every device needs a VPN (unless you go through the pain I've gone through), the server has to deal with many VPN tunnels, which isn't free either.
-
@girish If someone wants very complex setup - sure, they can opt for the VPN solution (even though I don't see that as a simple setup either). But whitelisting home / office IPs is very easy. Dynamic IPs are covered by dynamic dns.
VPN protection for bunch of users means every device needs a VPN (unless you go through the pain I've gone through), the server has to deal with many VPN tunnels, which isn't free either.
@girish If someone wants very complex setup - sure, they can opt for the VPN solution (even though I don't see that as a simple setup either). But whitelisting home / office IPs is very easy. Dynamic IPs are covered by dynamic dns.
In particular, if we could update such whitelisted IP i.e. via cli (or have a default setting that the current IP of the main Cloudron domain is always whitelisted…)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login