django安装好以后,需要配置nginx,找到nginx.conf文件进行配置的时候,location后边的写法要注意,空格

    server{
        listen  80;
        server_name cloud.i-erya.com;

        location / {
            root   /web/eatclouds;
            #index  index.html index.htm;
            #autoindex on;
            fastcgi_pass    backend_eatclouds;
            fastcgi_param   PATH_INFO       $fastcgi_script_name;
            fastcgi_param   REMOTE_ADDR     $remote_addr;
            fastcgi_pass_header             Authorization;
            include         fastcgi_params_django;
        }

        location ^~ /site_media{           #^~ 与 /site_media之间有空格
            alias  /web/eatclouds/media/;
        }

        location ^~ /static {                    #^~ 与 /static之间有空格
                alias /usr/local/python2.7.2/lib/python2.7/site-packages/django/contrib/admin/static/;
        }

        location ~*^.+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js|mov) {
               alias         /web/eatclouds/sitestatic/;
               access_log   off; # po co mi logi obrazk��w :)
               expires      30d;
        }
    }

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-26
  • 2022-03-08
  • 2022-01-17
  • 2022-12-23
  • 2021-06-19
  • 2022-12-23
猜你喜欢
  • 2021-06-29
  • 2022-12-23
  • 2021-07-19
  • 2021-05-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案