我想知道如何在托管多个 Web 应用程序的服务器中通过 IP 地址访问网站?
I would like to know how to access websites by IP address in a server that hosts more than one web application?
目前我可以获取服务器的IP地址,但默认指向一个站点.是否有前缀或后缀可以添加到 IP 地址以获取服务器中的特定网站?
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?
例如:我想通过 IP 地址访问:
Eg: I would like to access by IP address:
服务器通过 nginx 和 unicorn 托管了许多 ruby on rails 网络应用程序.
The server hosts many ruby on rails web apps via nginx and unicorn.
提前致谢.
推荐答案假设服务器有一个公共 ip 地址,并且被设置为服务虚拟主机,你可以这样做:
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" IPADDRESS
curl -H "Host: subdomain.domain" IPADDRESS
更多推荐
如何在托管多个网站的服务器中通过 IP 地址访问网站?
发布评论