Rory's Blog
Home
Blog
Projects
Facebook
Google+
Github
RSS

Site: My Tornado Nginx Conf

09/01/14

So, yesterday I tried to grok the example tornado configuration for nginx I found online. Today, I altered the configuration file to my needs, tried it out, failed, and then altered it until it worked.

Hmmm.... I think maybe I should put this in a github repo. Better linkage to the different files and stuff then.

Give me a second....

Done.

So, this is my updated version of the configuration file. I've set auto_processes to 1 and whittled down the upstream frontend servers down to the one I think I need.

I symbolically linked this file in the sites-enabled area and attempted to restart nginx.

sudo service nginx restart
Restarting nginx: nginx: [emerg] unknown directive "worker_processes" in /etc/nginx/sites-enabled/tornado:1
nginx: configuration file /etc/nginx/nginx.conf test failed

Eh?

Googling....

Explanation.

I'm redefining stuff defined in /etc/nginx/nginx.conf. Most of this whole configuration is already setup for me in that one, actually. Also, if you look closely at my configuration, I didn't actually name paths for the mime types and stuff like that. So, I whittled my configuration file down to this.

sudo service nginx restart Restarting nginx: nginx.

Success!

Check out my tornado site here. Isn't it super amazing, Stephan?