I have multiple apps like nextcloud, pihole, syncthing, photoprism, etc set up on TrueNAS Scale machine, along with Nginx Proxy Manager.
This is how each proxy host in NPM looks like:
All is well and good, https works, I can access the apps through URL like nextcloud.mydomain.com
Now I realized that all the traffic from client to server, even after being in same network, was travelling the internet and back as I use Cloudflare as my DNS. So around 120ms ping for each query, and some file uploads would eat up the internet bandwidth.
So I set up some static DNS hosts in the client's hosts file (Windows 11)
Like this:
So using tracert, I did find that the packet was not travelling outside LAN, which was the ideal result.
But now the apps are giving me "Connection Refused" errors on their URL. DNS resolution is fine, because if I try to access using domain:IP, it works (for example nextcloud.mydomain.com:<port>)
This is how each proxy host in NPM looks like:
SOURCE | DESTINATION | SSL | ACCESS | STATUS | |
---|---|---|---|---|---|
nextcloud.mydomain.com Created: 21st September 2022 | http://<truenasMachineIP>:<nextcloudPort> | Let's Encrypt | Public | Online |
All is well and good, https works, I can access the apps through URL like nextcloud.mydomain.com
Now I realized that all the traffic from client to server, even after being in same network, was travelling the internet and back as I use Cloudflare as my DNS. So around 120ms ping for each query, and some file uploads would eat up the internet bandwidth.
So I set up some static DNS hosts in the client's hosts file (Windows 11)
Like this:
Code:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
192.168.X.X nextcloud.mydomain.com
So using tracert, I did find that the packet was not travelling outside LAN, which was the ideal result.
But now the apps are giving me "Connection Refused" errors on their URL. DNS resolution is fine, because if I try to access using domain:IP, it works (for example nextcloud.mydomain.com:<port>)