WebFaction
Community site: login faq

I'm trying to deploy a Django web app using gunicorn behind nginx. This is my configuration nginx.conf file:

server {    
    listen       80;
    server_name  www.example.com;

    access_log   /some/path/access.log;
    error_log    /some/path/error.log;

    location  / {
        proxy_pass            http://127.0.0.1:11001/;
        proxy_redirect        off;
        proxy_set_header      Host             $host;
        proxy_set_header      X-Real-IP        $remote_addr;
        proxy_set_header      X-Forwarded-For  $proxy_add_x_forwarded_for;
        client_max_body_size  10m;
    }
}

My question is, which value should I use for port number in listen directive and proxy_pass?

How many Custom Apps (listening on port) should I create? Just one for nginx or one for nginx and one one for gunicorn?

asked 06 Oct '12, 17:26

Guandalino
3711218
accept rate: 0%


For your nginx you would use the port that is assigned from the control panel to listen on.

As well, going by this example you will also need to reserve a port for each instance of gunicorn you are going to run.

permanent link

answered 06 Oct '12, 18:14

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

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:

×185
×28
×21
×12

question asked: 06 Oct '12, 17:26

question was seen: 2,139 times

last updated: 06 Oct '12, 18:14

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2016 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