文件:
blogtest_nginx.conf
the upstream component nginx needs to connect to
upstream django {
server 127.0.0.1:8000; # for a web port socket (we'll use this first)
}
configuration of the server
server {
listen 8000;
server_name .example.com; # substitute your machine's IP address or FQDN
charset utf-8;
client_max_body_size 75M; # adjust to taste
location /media {
alias /home/aljun/djangotest/blogtest/media; # your Django project's media files - amend as required
}
location /static {
alias /home/aljun/djangotest/blogtest/statices; # your Django project's static files - amend as required
}
location / {
uwsgi_pass django;
include /home/aljun/djangotest/blogtest/uwsgi_params; # the uwsgi_params file you installed
}
}
当我执行:
uwsgi --socket :8001 --wsgi-file test.py
得到的却是400 badrequest
但是我的nginx跑起来了,http://localhost:8000/static/github1.css是有反应的
terminal的报错是
invalid request block size: 21573 (max 4096)...skip
求大神帮解答
而且这之前用http就没事,而用了socket就出问题了
我之前是server 127.0.0.1.8001,也是400,才改成的8000的,测试uwsgi过了,用http而不是socket时是可一运行test.py的