django、nginx、gunicorn 404 在根以外的任何其他页面上

django, nginx, gunicorn 404 on any other page than the root

我的问题是,每当我尝试查看不是根网页(又名 /user/nginx)的网页时 returns 出现 404 错误并且错误日志状态 找不到“/usr/share/nginx/html/user/login/index.html”。

当前的 nginx 配置

server {
    listen 80;
    server_name ip_address;

    location = /static {
         root /opt/scrumban/kanbanboard/;
         autoindex off;
     }

    location = / {
        include proxy_params;
        proxy_pass http://unix:/opt/scrumban/kanbanboard/kanban.sock;
    }
}

删除那些=标志;它们意味着只有路径“/”和“/static”匹配。没有符号,它们作为前缀匹配,这就是你想要的。