Assuming that the server has one public ip address, and been set up to serve virtual hosts, you can do that like this:
curl -H "Host: subdomain.domain.com" IPADDRESS
Domanda
I would like to know how to access websites by IP address in a server that hosts more than one web application?
Currently I can get the IP address of the server, but it points to one site by default. Is there a prefix or suffix that I can add to the IP address to get a particular website in the server?
Eg: I would like to access by IP address:
http://mysubdomain1.domain.com
http://mysubdomain2.domain.com
http://mysubdomain3.domain.com
The server hosts many ruby on rails web apps via nginx and unicorn.
Thanks in advance.
Soluzione
Assuming that the server has one public ip address, and been set up to serve virtual hosts, you can do that like this:
curl -H "Host: subdomain.domain.com" IPADDRESS
Altri suggerimenti
I don't think your question has enough information to be answered accurately not in depth.
Here are some thoughts.
There are different ways in which websites can be hosted. Via IP, aliases, named virtual hosts, etc.
There's a good chance that the server that's hosting those websites uses named based virtual hosts https://www.digitalocean.com/community/articles/how-to-set-up-nginx-virtual-hosts-server-blocks-on-ubuntu-12-04-lts--3
That is, one ip points to multiple servers. In that case, the only way you can get to it, is by knowing the domain name.
Here's more or less how it would work