1 个回答
新手上路,请多包涵

需要更改nginx的配置文件

        server {
            listen 80;
            server_name localhost;
            location / {
                proxy_pass http://0.0.0.0:8000;
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            }
            error_page 500 502 503 504 /50x.html;
            location = /50x.html {
                root html;
            }
            location /media {
                alias /root/bookstore/bookstore/static;#你的静态文件的目录
            }
            location /static {
                alias /root/bookstore/bookstore/static; #你的静态文件的目录
            }
        }

将以下代码注释掉

    # include /etc/nginx/sites-enabled/*;

具体操作请访问DJANGO项目利用NGINX+GUNICORN实现简单部署

里面有详细教程

推荐问题