zoukankan      html  css  js  c++  java
  • Django+nginx+uwsgi静态文件permission denied!

    把项目部署到服务器上之后,没有样式,静态文件没有找到。

    通过查看nginx的错误日志,发现nginx请求的静态文件提示“permission denied”

    意识就是没有权限,查找资料,发现修改nginx.conf的配置可以解决问题。

    (env) [root@ nginx]# cat nginx.conf

    user root; 默认是nginx,改成root就可以了。
    worker_processes 1;

    error_log /var/log/nginx/error.log warn;
    pid /var/run/nginx.pid;


    events {
    worker_connections 1024;
    }


    http {
    include /etc/nginx/mime.types;
    default_type application/octet-stream;

    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';

    access_log /var/log/nginx/access.log main;

    sendfile on;
    #tcp_nopush on;

    keepalive_timeout 65;

    #gzip on;

    include /etc/nginx/conf.d/*.conf;
    }

  • 相关阅读:
    01.Markdown学习
    微信小程序开发基础
    如何在本地搭建微信小程序服务器
    Golang | 报错
    Golang | 扩展
    Golang | 基础
    Golang | 基础
    Golang | 基础
    Chrome——书签同步码云
    Rustlings_structs
  • 原文地址:https://www.cnblogs.com/qinghuaL/p/9578539.html
Copyright © 2011-2022 走看看