Scale up as you grow — whether you're running one virtual machine or ten thousand.

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.

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!
Awesome! thanks for this! finally got my instance up and running…
I was actually following your other guide on deployment for ubuntu 14, when I provisioned ubuntu 16. Was racking my head trying to sort through the difference between systemd and upstart. tried converting files… asking ubuntu 16 to revert to upstart… all to no avail… until this tutorial popped up…
thanks again. have a good day!
This comment has been deleted
Warning, anyone following or reading this tutorial there is an error at “/etc/nginx/sites-available/myproject” part.
uwsgi_pass unix:/home/sammy/myproject/myproject.sock;
Should be
uwsgi_pass unix:///home/sammy/myproject/myproject.sock;
This should solve any 502 gateway error’s
Good instructions for the most part. However calling everything myproject is really confusing. Everyone who reads this will agree.
…Or you can learn Docker and leave the Nginx / uWSGI to an image like this one: https://hub.docker.com/r/tiangolo/uwsgi-nginx-flask/
And just worry about your Flask app.
Also, if you latter want to use a DB like MySQL or Postgres you can add it very easily with Docker. Without having to learn each system and it’s configurations. And the same with most other stacks (Redis, ElasticSearch, Celery with RabbitMQ, etc). (It’s totally worthwhile to learn Docker).
My .conf file is similar to what you’re told to put here, yet it always tells me that the server directive is not allowed when I do sudo nginx -t.
nginx: configuration file /etc/nginx/nginx.conf test failed
Interestingly it complains about that specific .conf file, rather than the location recommended in this article. ( /etc/nginx/sites-enabled/myproject )
Also, here’s some information I heard earlier, if someone can tell me if this sounds about right…
That most people do not run their webserver applications directly on port 80 or 443, they usually run it on a higher level port that would not give the application root level access. Is this accurate? If so what would we do to change the default port, so that it does not have to be included in the URL.
Hey Justin!
This worked out perfectly for me. Only one issue I have is that one of my python modules would like to use Java. When it tries to find the path it can’t find it. I edited the module and hardcoded the path and I managed to find out it says Permission Denied now. What are the proper steps to securely allow the python module within the virtual environment to access Java? I tried a bunch of different things but nothing ended up stopping the Permission Denied issue from coming up.
Thanks a bunch!
I am getting 502 bad gateway In nginx error logs I can see that its not able to find project.sock file When I checked in my project folder there is no sock file. How will it be generated?
I tried generating manually and chmod-ing it but then I get connection refused
The app is getting served only in my browser. Its not getting served in other devices!!!