Need help, how to remove remote address in my requests for it exposed the ip address of my server?
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?
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;
}
}