WebFaction
Community site: login faq

Hi thanks!

for a start, I have followed the tutorial here and i have managed to get the Tornado app up and running based on the tutorial.

However, I'm not too sure how to run Tornado via Nginx while using Supervisor to monitor the python process. I have followed the tutorial here to compile my own nginx, and have also managed to run nginx successfully.

So my questions are:

  1. i'm not sure about the next step: how to run the Tornado app using Nginx with Supervisor monitoring the process. Is there any one who can let me know how do it ?

  2. I'm not too sure what is the specific nginx configuration for my tornado app, based on the above 2 tutorials i have mentioned

  3. if i were to use the supervisor configuration based on the tutorial, what will my nginx file look like for my specific tornado app ?

Thanks!

asked 30 Aug '13, 11:55

Noobie
111
accept rate: 0%

edited 30 Aug '13, 19:17

johns
5.3k212


To try and answer all 3 questions and explain each server app a bit more,

The server 'stack' you pick for the site is a separate problem from how you will keep them online, so think of nginx/tornado as one half and supervisor as another. Although there may be many blogs/posts with good resources out there explaing how all 3 work together you have to understand each one by itself and nothing is better than the official docs for each of the 3 server apps,

Tornado

Nginx

Supervisor

Typically(on a VPS, or any other *inx based host where you are root) you must build/install a webserver and manage it on port 80 yourself. People choose Nginx for this since it is a fast and secure server which is good at proxying to other servers and saves memory and CPU on things like images and static files compared to the server which processes the python code.

On our platform you don't have to manage a server on port 80 since we use nginx on port 80 as the server behind the control panel configuration and we manage it for you.

You can build nginx, or any HTTP server as a custom app if you need full control of the configuration, part of the instructions you assign a port or set up static media with the control panel, which is actually nginx. Setting up a custom nginx behind our front-end one is what this blog is explaining how to do, for the purpose of more than average control over the server. However, we automate and provide direct access to the front-end server a few common tasks such as mapping a port for HTTP traffic of a secondary server, and setting up static media, which for most sites is all you need nginx for.

This image from our docs will help illustrate the server stack.

Once you have the python code being served on the root URI with a Tornado server a 'custom app', and your static media set up as a 'static only' app, and the domain is configured as the above documentation outlines than you can look into supervisord and how it works to keep processes online, which by than should be a straightforward process since you will know how to start/stop the processes which drive the site.

We are also happy to answer specific questions which require looking at the code/control panel setup with a support ticket.

permanent link

answered 30 Aug '13, 19:54

johns
5.3k212
accept rate: 23%

hi! thanks for the reply. does that mean that once u run a Tornado app as a custom app on Webfaction ( listening to the port assigned to the app ), i do not need to install and run my own nginx since Webfaction already does that for me ?

So this means that by following the tutorial here ( http://skipperkongen.dk/2013/01/02/deploying-a-tornado-project-in-production-using-github-and-webfaction/ ) I am already running my tornado instance behind nginx ?

Thanks!

(30 Aug '13, 21:34) Noobie

That's correct. Using that tutorial will set Tornado up behind the shared Nginx instance, which will proxy incoming requests to your Tornado instance.

(30 Aug '13, 21:55) waynek
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×186
×11
×8
×5

question asked: 30 Aug '13, 11:55

question was seen: 8,307 times

last updated: 30 Aug '13, 21:55

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM