Add run details for nginx and uwsgi
korymath opened this issue · comments
Kory commented
Reference the guide here:
https://uwsgi-docs.readthedocs.io/en/latest/tutorials/Django_and_nginx.html
You will need the uwsgi_params file, which is available in the nginx directory of the uWSGI distribution, or from https://github.com/nginx/nginx/blob/master/conf/uwsgi_params
Copy it into your project directory. In a moment we will tell nginx to refer to it.
/etc/nginx/sites-available/JANN.conf
# JANN.conf
# the upstream component nginx needs to connect to
upstream flask {
# for a web port socket
server 127.0.0.1:8001;
}
# configuration of the server
server {
# the port your site will be served on
listen 8000;
# the domain name it will serve for
server_name IP; # substitute your machine's IP address or FQDN
charset utf-8;
# Finally, send all non-media requests to the Django server.
location / {
uwsgi_pass flask;
# the uwsgi_params file you installed
include /home/korymath/jann/uwsgi_params;
}
}
sudo ln -s ~/path/to/your/mysite/mysite_nginx.conf /etc/nginx/sites-enabled/
sudo /etc/init.d/nginx restart
uwsgi --socket :8001 -w wsgi:JANN