我遵循了我在此处找到的教程,当我尝试访问静态文件时,我得到一个找不到页面的错误。这是我关注的教程https://gist.github.com/evildmp/3094281
这是在 nginx 的错误日志文件中。2013/07/17 09:55:15 [emerg] 2891#0:/etc/nginx/nginx.conf:2 中不允许“上游”指令
这是我的 nginx 配置文件
# nginx.conf
upstream django {
# connect to this socket
# server unix:///tmp/uwsgi.sock; # for a file socket
server 127.0.0.1:8000; # for a web port socket was 8001
}
server {
# the port your site will be served on
listen 8000;
# the domain name it will serve for
server_name inventory.ien.gatech.edu; # substitute your machine's IP address or FQDN
charset utf-8;
#Max upload size
client_max_body_size 75M; # adjust to taste
# Django media
location /media {
alias /Desktop/Projects/Newest/IEN_Inventory/Inventory/templates/media; # your Django project's media files
}
location /static {
alias /Desktop/Projects/Newest/IEN_Inventory/Inventory/templates/media; # your Django project's static files
}
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params; # or the uwsgi_params you installed manually
}
}
感谢您的任何帮助或建议。