Answer the question
In order to leave comments, you need to log in
How to fix error with Uwsgi + Nginx?
sudo service nginx restart
Restarting nginx: [emerg]: unknown directive "uwsgi_pass" in /etc/nginx/sites-enabled/project:16
configuration file /etc/nginx/nginx.conf test failed
#project.nginx
server {
listen 8080;
server_name localhost;
access_log /var/log/nginx/nginx-testprj-access.log;
error_log /var/log/nginx/nginx-testprj-error.log;
root /var/www/nginx-default/project/django/project/;
location / {
try_files $uri /static/$uri
@django_uwsgi;
}
location / {
uwsgi_pass django;
include uwsgi_params;
}
}
Answer the question
In order to leave comments, you need to log in
add at the beginning
upstream django {
# server unix:///path/to/your/mysite/mysite.sock; # взаимодействие с uwsgi через Unix-сокет (мы воспользуемся этим вариантом позже)
server 127.0.0.1:8001; # взаимодействие с uwsgi через веб-порт
}
location / {
try_files $uri /static/$uri @django_uwsgi;
}
location django_uwsgi {
uwsgi_pass django;
include uwsgi_params;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question