在nginx中配置未路由的域以转到特殊文件夹?

在nginx中配置未路由的域以转到特殊文件夹?,nginx,configuration,Nginx,Configuration,我正在尝试将我的nginx配置为处理未路由的域,以便它们进入未路由域的特殊文件夹,而不是从我的主域文件夹加载未路由域 例如: http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name somedomain.com;

我正在尝试将我的nginx配置为处理未路由的域,以便它们进入未路由域的特殊文件夹,而不是从我的主域文件夹加载未路由域

例如:

http {
    include mime.types;
    default_type application/octet-stream;
    sendfile on;
    keepalive_timeout 65;

    server {
        listen 80;
        server_name somedomain.com;
        root C:/web_root/somedomain.com;
        index index.html index.htm;
    }
    server {
        listen 80;
        server_name localhost;
        root C:/web_root/unrouted;
        index index.html index.htm;
    }
}
因此,我希望所有试图为我的服务器设置A记录的访问者都转到特殊的未路由文件夹

谢谢你的帮助

默认服务器(即没有明确的
服务器名称
匹配)是第一个具有匹配端口的
服务器
容器。除非在相应的
listen
指令中使用
default\u server
关键字指定默认服务器:

listen 80 default_server;

看一看。

谢谢,看来我只是误读了它,把
servername 80默认值\u server和离开
听80原样。