Following this great tutorial I was able to configure my website to run the django app I’m developing. Now what I’d like to do would be to set up NGINX and gunicorn to run my server like this:
www.mydomain.com -> static webpage (pelican, bootstrap) www.mydomain.com/pmapp -> Django app I’m developing
I did try this with no luck.
Any help, idea?
thanks a lot
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
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.
Using two different Nginx server blocks would be the right approach if you are serving one of the sites from a different domain or sub-domain. If you’d like to serve the Django app from a sub-folder, you will need to make use of a location directive in the same server block.
The details may differ for your exact setup, but here is a basic example of serving a static site from the main domain and a Django project from a subfolder:
Two very important parts in the location directive that are specific to hosting from the subfolder are:
This ensures that the Django app will generate URLs with the correct prefix in the path (e.g.
Hope that helps point you in the right direction!
This comment has been deleted
Want to learn more? Join the DigitalOcean Community!
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Sign up now