单个服务器下的多位置配置

时间:2019-11-25 03:00:26

标签: nginx

我有两个提供静态内容的虚拟目录(portal1和portal2)。这是我的nginx配置。由于某种原因,除了/在位置之下外,它不采取任何其他措施。我有什么想念的吗?

worker_process 1;
events { worker_connections 1024; }

http {
   include mime.types;
    sendfile on;
    server {
      listen 95;
      server_name localhost;
      location /portal1 {
          root /usr/share/nginx/html/portal1;
          index index.html;
      }

      location /portal2 {
          root /usr/share/nginx/html/portal2;
          index index.html;
      }



    }
}

我正在尝试访问URL:

localhost:95 / portal1 本地主机:95 / portal2

我一直都找不到404。

0 个答案:

没有答案
相关问题