Nginx从配置文件中拿到错误的目录

我已经编写了nginx的配置文件,但是一些原因,nginx会寻找目录/pipelines/videos/neuralAI.mp4,而不是去找/pipelines/assets/neuralAI.mp4。如果有任何帮助,将不胜感激。

  location /videos/ {
    access_by_lua_block {
        if(ngx.var.maintenance == "on") then
            local authorize = require("authorize")
            local maintenance = ngx.var.maintenance
            authorize.validate_access(nil, nil, "/videos", "{DEPLOYMENT}", maintenance)
        end
    }
    root /pipelines;
    proxy_temp_path /usr/local/openresty/nginx/temp/proxy_temp;
    client_body_temp_path /usr/local/openresty/nginx/temp/client_body_temp;
    fastcgi_temp_path /usr/local/openresty/nginx/temp/fastcgi_temp;
    uwsgi_temp_path /usr/local/openresty/nginx/temp/uwsgi_temp;
    scgi_temp_path /usr/local/openresty/nginx/temp/scgi_temp;
    access_log /usr/local/openresty/nginx/logs/access.log;
    error_log /usr/local/openresty/nginx/logs/error.log;
  }

日志文件中的错误信息:

9:26:17 [error] 33#33: *11 open() "/pipelines/videos/neuralAI.mp4" failed (2: No such file or directory), client: 192.168.172.1, server: , request: "GET /videos/neuralAI.mp4 HTTP/1.1", host: "route.corp.com"

目录:

bash-4.2# pwd
/pipelines/assets
bash-4.2# ls -l
total 26068
-rw-r--r--. 1 1000 1000 26692604 六月  17 19:24 neuralAI.mp4
bash-4.2#

谢谢您的阅读。

原文链接 https://stackoverflow.com/questions/69228830

点赞
stackoverflow用户16098755
stackoverflow用户16098755

我已经使用别名而不是根目录来解决了这个问题。

2021-09-20 02:25:56