Well, or register a different domain + nginx + proxy_pass + set $host + ...
A website case there are no direct references to his (non-existent) domain?
If there is then you have to do differently, filter, html, css, js and replace the old domain with the new one.
Something like
https://www.ruby-forum.com/topic/178781
UPD. Did not understand the problem - nginx or squid? The website should earn for all or only those who have access to the proxy? If using a proxy, then, may suffice to bring it on the host, configure squid to the local name resolver and all.