nginx - uwsgi ini file configuration -
i have python application running on server. try configure uwsgi server in application.
uwsgi.conf file location : /etv/init/uwsgi.conf
# file: /etc/init/uwsgi.conf description "uwsgi starter" start on (local-filesystems , runlevel [2345]) stop on runlevel [016] respawn # home - path our virtualenv directory # pythonpath - path our django application # module - wsgi handler python script exec /home/testuser/virtual_environments/django-new/bin/uwsgi \ --uid root \ --home /home/testuser/virtual_environments/django-new \ --pythonpath /home/testuser/django \ --socket /tmp/uwsgi.sock \ --chmod-socket \ --module wsgi \ --logdate \ --optimize 2 \ --processes 2 \ --master \ --logto /var/log/uwsgi.log
and have create .ini file.
/etc/uwsgi/app-available/uwsgi.ini
[uwsgi] home = /home/testuser/virtual_environments/django-new pythonpath = /home/testuser/django socket = /tmp/uwsgi1.sock module = wsgi optimize = 2 processes = 2
nginx configuration:
/etc/nginx/site-available/default
upstream uwsgicluster { #server unix:/tmp/uwsgi.sock; server unix:///tmp/uwsgi1.sock; } server { location / { uwsgi_pass uwsgicluster; #uwsgi_pass unix:/run/uwsgi/app/scisphere/socket; #proxy_pass http://uwsgicluster; include /etc/nginx/uwsgi_params; } location /static { root /home/testuser/django/main; } location /media { root /home/testuser/django; } }
i try start server:
sudo service uwsgi start
i getting 502 bad gateway error. , how config uwsgi.ini file in uwsgi.conf
pls 1 me.
thanks & advancd
add include uwsgi_params;
below uwsgi_pass uwsgicluster;
.
Comments
Post a Comment