Topic: Configure Nginx Web Proxy

Topic type:

Set up the Nginx web proxy in the context of the installation guide.

Originally written by Walter McGinnis, Kete Project Lead for Katipo Communications, Ltd.

Part of the Installation Guide


Important Note: This step assumes that you are logged in as the user who will be running your Kete. For demos and development this is likely your normal account, for production this is the "kete" account if you have followed the conventions laid forth in the last step.

Configure your Nginx web proxy

First, download the appropriate template for your Nginx configuration.

Using Nginx 0.6.x

If you are doing the simple installation, go to here and download the document. If you are doing the installation with Capistrano, go here and download that document.

Using Nginx 0.5.x

If you are doing the simple installation, go to here and download the document. If you are doing the installation with Capistrano, go here and download that document.

Configuration

Next, edit the template adjusting your_app, your_user_account, your_home_directory_path and upstream lines to match your mongrel cluster ports appropriately.

Then do this:

$ sudo cp /usr/local/nginx/conf/nginx.conf /usr/local/nginx/conf/nginx.conf.orig # back up the original nginx.conf incase things go wrong
$ sudo cp your_edited_nginx_conf_file /usr/local/nginx/conf/nginx.conf

Now start or restart nginx:

On Debian or other Linux distributions that use /etc/init.d (and you have set up /etc/init.d/nginx):

$ sudo /etc/init.d/nginx restart

On Mac OS X, you likely haven't started nginx yet. You can use this:

$ sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf

On Mac OS X, if nginx is already running use this to stop nginx first:

$ ps auxw | grep nginx # choose the pid for the master process run by root from the result
$ sudo kill the_master_pid

I haven't found a launchd plist for nginx for starting up automatically at boot yet. Please let me know in discussion if you find one.



Next step:
Configure your Kete site

Discuss This Topic

There are 1 comments in this discussion.

Read and join this discussion

join this discussion