配置多个站点404
我选择了配置多个location。

location / {
         root   /data/html/;
         index  index.html index.html;
    }
    location /publicity {
         root /usr/local/nginx/hzcloud-timp-front/;
         index  index.html index.htm;
    }

配置完以后访问。http://xxxx/train 提示404
找了好久才搞明白, location如果一个特定的url 要使用别名,不能用root,alias指定的目录是准确的,root是指定目录的上级目录,改动后即可以使用了

location /publicity {
         alias /usr/local/nginx/hzcloud-timp-front/;
         index  index.html index.htm;
    }

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
  • 2021-09-28
  • 2022-02-25
  • 2022-12-23
猜你喜欢
  • 2022-03-05
  • 2022-12-23
  • 2022-12-23
  • 2022-02-18
  • 2022-12-23
相关资源
相似解决方案