i am working on website, i would like to hide it from general public and search engines.
i have vps X
, for hosting this site.
and another vps Y
, which will be front for general public. vps Y will be used as nginx
reverse proxying
to vps X
.
so i dont want people to know about vps X
. people should not be able to access site directly by accessing vps X
.
site should be only visible if people access domain name which in turn connected to vps Y
.
what is the best way to achive something like this ?
edit : so far i can think of few ways.,
so far i can think of these options.
1 ) on vps X
, set website on port other than 80
and do reverse proxy from vps Y
to vps X:port other than 80
2 ) set cloudflare on vps X,
and allow only connections which comes from clouflare
.
-aparently cloudflare only works with port 80
3) on vps X
, password protect website using basic http authentication
.
on vps Y
, while doing reverse proxy pass username and password
.
4) on vpx X
check for special cookie, which will be set by vps Y
, if cookie
is found then only grant access.
vps Y
sets cookie to upstream server
while making proxy request.