Deploying Django apps with nginx

47 views
Skip to first unread message

Sandeep kaur

unread,
Nov 10, 2013, 7:20:27 AM11/10/13
to django-users
Hi,
I want to deploy multiple django apps on a server with nginx. When we do it on apache
we do it in /etc/apache2/httpd.conf and following content :

 WSGIScriptAlias /django /home/sandy/django_app/apache/django.wsgi             
 <Directory /home/sandy/django_app/apache/>                                  
 Order allow,deny                                                      
 Allow from all                                                        
 </Directory>

Thus this app can be accessed by example.com/django or if any other app on same server then with example.com/django2. How can we do this with nginx?

Your help will be appreciated. :)
Thank you.

--
Sandeep Kaur
E-Mail: mkaur...@gmail.com
Blog: sandymadaan.wordpress.com



Thomas Orozco

unread,
Nov 10, 2013, 8:49:43 AM11/10/13
to django...@googlegroups.com
Using Nginx, you don't tun the django app "inside" Nginx like you would using mod_wsgi.

Instead, you use Nginx for reverse proxying (see the proxy_pass directive), and use a Python webserver for your app(s), e.g. uwsgi, gunicorn.

Serving multiple apps is easy. Just use multiple location blocks and proxy_pass directives.

Cheers, 


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAF66xG3e34QLWBHvpPO%2B72JAA9FbK3Oo%3DRNO-YuyLvb2LU-aFw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Timothy W. Cook

unread,
Nov 10, 2013, 9:25:57 AM11/10/13
to django...@googlegroups.com
This should help
http://michal.karzynski.pl/blog/2013/10/29/serving-multiple-django-applications-with-nginx-gunicorn-supervisor/
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users...@googlegroups.com.
> To post to this group, send email to django...@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAF66xG3e34QLWBHvpPO%2B72JAA9FbK3Oo%3DRNO-YuyLvb2LU-aFw%40mail.gmail.com.
> For more options, visit https://groups.google.com/groups/opt_out.



--
MLHIM VIP Signup: http://goo.gl/22B0U
============================================
Timothy Cook, MSc +55 21 94711995
MLHIM http://www.mlhim.org
Like Us on FB: https://www.facebook.com/mlhim2
Circle us on G+: http://goo.gl/44EV5
Google Scholar: http://goo.gl/MMZ1o
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
Reply all
Reply to author
Forward
0 new messages