Hello I have 2 Django Application that I want to run in a same server and I have 2 domain name. Please tell me how to host this 2 Django Application in same server this is the domain and file locations for my application.
First Application —> Domain --> harshblog.tech file location for my project --> /home/harsh/harshblog file location for my python environment --> /home/harsh/harshblog/env file location for my wsgi.py --> /home/harsh/harshblog/harshbloging/wsgi.py
Second Application --> Domain --> kingofmemes.xyz file location for my project --> /home/harsh/harshmemes file location for my python environment --> /home/harsh/harshmemes/env file location for my wsgi.py --> /home/harsh/harshmemes/memes/wsgi.py
If you need more information related to this 2 Application please tell me and please help me. This 2 application is running on apache2 in different server. So, I want to run this 2 applications in nginx in a same server.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Click below to sign up and get $100 of credit to try our products over 60 days!
Hello,
This should be achievable with Nginx server blocks as per this tutorial here:
https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04
Once you have your two Nginx server blocks, you can configure them as per the instruction in the
Configure Nginx to Proxy Pass to Gunicorn
step in this tutorial here:https://www.digitalocean.com/community/tutorials/how-to-set-up-django-with-postgres-nginx-and-gunicorn-on-ubuntu-16-04
Hope that this helps! Regards, Bobby