Nginx and uwsgi are installed, tested, no problem, and then when using uwsgi to start the django project, using the browser to view the project will have the problem that static files cannot be loaded. No matter how to configure it, I can"t do it well. I ask for advice from God.
nginx configuration, path is: / etc/nginx/conf.d/default.conf
server {
listen 80;
server_name 192.168.127.128;
charset UTF-8;
access_log /var/log/nginx/SecondSpace_access.log;
error_log /var/log/nginx/SecondSpace_error.log;
location / {
include uwsgi_params;
uwsgi_pass 192.168.127.128:8000;
uwsgi_read_timeout 2;
root /usr/share/nginx/html;
index index.html index.htm;
}
location /static {
expires 30d;
autoindex on;
add_header Cache-Control private;
alias /home/dh/PycharmProjects/python/SecondSpace/static;
}
location /media {
expires 30d;
autoindex on;
add_header Cache-Control private;
alias /home/dh/PycharmProjects/python/SecondSpace/media;
}
-sharperror_page 404 /404.html;
-sharp redirect server error pages to the static page /50x.html
-sharp
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}
}
then comes the configuration of uwsgi.ini. The path is: / home/dh/PycharmProjects/python/SecondSpace/uwsgi.ini (my project directory when SecondSpace)
[uwsgi]
socket=:8000
chdir = / home/dh/PycharmProjects/python/SecondSpace
module = SecondSpace.wsgi
master=true
processes = 4
vacuum = true
ask the great god for advice. There is nothing I can do. I have finished reading the online tutorial. -sharp-sharp-sharp problem description
the environmental background of the problems and what methods you have tried
related codes
/ / Please paste the code text below (do not replace the code with pictures)