Natvps.id – For users NAT VPS Hostdata.id With any package, it might experience obstacles in accessing a domain that leads to the public IP from inside NAT VPS itself.
For example, a user installs N8N In VPS NAT, and Install Reverse-Proxy Like Nginx along with DNS configurations that lead to the VPS public IP. If domain N8N is accessed From inside VPS NATthen the request will Deadline And cannot be connected to the application, even though the application is on the same server.
However, if the application is accessed using a private IP or through the address localhostthen it will be fine.

How did it happen?
Reason
This is due to NAT VPS using 1 public IP used by various users (sharing).
Because NAT VPS uses features Network address translation (Nat), when we access the domain or public IP, we really accessing the server with our own IP. So that, request will not be sent and also cannot be connected. This is caused by request comes from the same server as a public IP, and the request will “confusion” about the final goal.
To test it, do it Ping heading to the NAT public IP, from the same VPS NAT. Example:

Request will DeadlineAs explained earlier.
Solution
To overcome this, there are several solutions that can be used.
1. Add the domain to the host file
We can add “exceptions” / put aside for the domain that we want to access in the file /etc/hostsSo that when we access the domain, the IP we access is Private IP from NAT VPS, not a public IP. With this, request Will not go out to the public IP, but directly to the internal IP.
The trick, add our private IP along with the domain to the file /etc/hosts:
ip_private=$(ip route get 8.8.8.8 | awk '{print $NF; exit}')
echo "$ip_private domainanda.com" | sudo tee -a /etc/hosts
ip_private is a variable that contains your NAT VPS Private IP, which is taken automatically. Then, the IP, along with the domain you want to access, will be added to the host file.
For example, if I have a domain n8n.mdinata.my.id And want to access it through the same NAT VPS, so I need to add:
ip_private=$(ip route get 8.8.8.8 | awk '{print $NF; exit}')
echo "$ip_private n8n.mdinata.my.id" | sudo tee -a /etc/hosts

You can also edit files /etc/hosts using text editors like nano:
apt install nano -y # Jika belum nano /etc/hosts
Game Center
Game News
Review Film
Rumus Matematika
Anime Batch
Berita Terkini
Berita Terkini
Berita Terkini
Berita Terkini
review anime