I am trying to setup uwsgi and Django on Nginx but showing page not found error and error logs are empty. I cannot identify the error because the error logs are empty.
Error log /var/log/nginx/error.log
:
-rw-r--r-- 1 www-data root 0 Feb 26 12:31 error.log
uswgi is running properly because I tested this on following method:
uwsgi --http :8080 --home /home/flybegins/python/django/venv/ --chdir /home/flybegins/python/django/sample -w sample.wsgi
virtual host
server {
listen 80;
server_name test.aaaaaaa.com;
error_log /var/log/nginx/error.log
location /static/ {
root /home/flybegins/python/django/sample/
}
location / {
include uwsgi_params;
uwsgi_pass unix:/home/flybegins/python/django/sample/sample.sock;
} }
Virtual host permission:
-rw-r--r-- 1 root root 333 Feb 27 08:54 test.aaaa.com
Thanks in advance!
You need to install python plugin for uwsgi
or for python 3
I did two mistakes One is nginx virtual host configuration and another one is socket permission error
uWSGI Configuration
To create the space for the socket to exist, you just have to pick a persistent directory (e.g. not /run or /tmp) and make www-data (the user nginx runs as) the owner of it, as such:
My nginx virtual host configuration
You are running your project using port 8080 with this code:
And you are trying to bind NGINX to a socket file that doesn't exist using this configuration:
That why it doesn't work.