Need help, how to remove remote address in my requests for it exposed the ip address of my server?
Asked
Active
Viewed 5,033 times
2 Answers
3
You can't, that is the IP address that your domain resolves to and is used by the browser (and everything else) to know which server to speak to. Even if you could hide it in the browser, it would be easy for anyone to find out (e.g. ping mydomain.co.uk
would also reveal the same IP).
Revealing the IP address shouldn't be a problem though, why do you want to hide it?

James Baker
- 1,143
- 17
- 39
-
If that's the case, is it possible to replace with the domain name, it's bit annoying to see the ip address and expose even the port. Any suggestion? – Luxknight007 Dec 21 '18 at 15:46
-
No, I don't believe so as the request will have to resolve to an IP address for it to be actioned. The domain name is essentially an alias for humans, but a computer communicates via IP addresses (using DNS to resolve domains to an IP address) and so it requires that information. – James Baker Dec 21 '18 at 15:56
-
1Thanks appreciate the effort. – Luxknight007 Dec 21 '18 at 16:17
1
You can place NGINX on an additional server and used as Proxy, so you proxy pass the requests to the origin/application server and the client will not see this IP.
# Your hidden server server
upsream **hidden** {
server myhiddenapp.com;
}
# Webserver
server {
listen 80 default;
server_name publicdomain.com;
location / {
proxy_pass http://**hidden**;
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}

Garistar
- 363
- 3
- 8