我有4个域和1个服务器。我安装了nginx并放置了4页登陆页。
其中一个例子是:
server {
listen 2000;
root /path/to;
index index.html;
server_name 1.1.1.1;
location / {
allow all;
}
}我如何可以重定向我的域名为其中一个登陆页面?例如,当我打开页面http://mydomain.com时,我从address 1.1.1.1:2000获得登陆页面。
发布于 2014-03-27 16:22:54
尝尝这个。这将在不同的端口上监听。所以你必须通过example1000.com:1000来访问它。或者您可以更改所有的聆听80,并通过example1000.com、example2000.com等访问它。
server {
listen 1000;
# The host name to respond to
server_name example1000.com;
# Path for static files
root /sites/example1000.com/public;
# Index
index index.html
}
server {
listen 2000;
# The host name to respond to
server_name example2000.com;
# Path for static files
root /sites/example2000.com/public;
# Index
index index.html
}https://stackoverflow.com/questions/22690362
复制相似问题