Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #56282

nginx config: different projects in different directories

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <jabba.laci@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.132
X-Spam-Level *
X-Spam-Evidence '*H*': 0.74; '*S*': 0.00; 'configure': 0.05; 'charset': 0.16; 'entry:': 0.16; 'skip:u 50': 0.16; 'subject:projects': 0.16; 'thanks,': 0.17; 'instance,': 0.24; 'questions:': 0.24; 'environment': 0.24; 'skip:@ 10': 0.30; 'message-id:@mail.gmail.com': 0.30; "i'm": 0.30; 'too.': 0.31; 'this.': 0.32; 'figure': 0.32; '(e.g.': 0.33; 'problem': 0.35; "can't": 0.35; '(2)': 0.35; 'received:google.com': 0.35; 'add': 0.35; 'hi,': 0.36; 'application': 0.37; 'two': 0.37; 'project': 0.37; 'server': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'called': 0.40; 'how': 0.40; 'skip:u 10': 0.60; 'new': 0.61; 'address': 0.63; 'different': 0.65; 'here': 0.66; 'production': 0.68; 'directory:': 0.84; 'skip:/ 30': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:content-type; bh=UByj/2FQC8R9w72PoYIRhEDfCAFbBb3Kg4QLI/mUAfE=; b=rK33lzsGMqz8Es6nTTgOlQPCg5VCJRWZqFuJKw6NzTdBolFnzKNP+sPThKyrD073SO LhjuYte47b3O9tpkV4KC+FWF8vlyF0pfDMAKcj8QqPvHUewTM4eMfPBCCv3fCtgE7Sed YiwMIHz+3VmMpNwckRHZ99QnJYUkMRNDOz4TPJTuOE0jJ0XskdEjNcDX3oWuQCbJ7zDJ GnH/YBVy99jZYaB2INEuPjltRzhAfSUUBqoSM3e44Cw6VfJ/rqsXuIrp26nFmULZKVYe HHQQzm/UP56PKllhWa4ePX9Dm+F7V+MZAi02gUsExXne3eSlh4JKIntg4PXz8HUrnwji BihA==
X-Received by 10.60.118.70 with SMTP id kk6mr43047577oeb.22.1381094723983; Sun, 06 Oct 2013 14:25:23 -0700 (PDT)
MIME-Version 1.0
From Jabba Laci <jabba.laci@gmail.com>
Date Sun, 6 Oct 2013 23:25:03 +0200
Subject nginx config: different projects in different directories
To Python mailing list <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.796.1381094733.18130.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381094733 news.xs4all.nl 15903 [2001:888:2000:d::a6]:36576
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56282

Show key headers only | View raw


Hi,

I'm playing with Flask and I would like to try it in production
environment too. I managed to bring Flask together with uwsgi and
nginx. My Flask application is available at the address localhost:81 .

I would like to add several applications and I want them to be
available under different URLs. For instance, if I have two projects
called "hello" and "world", I want to access them as
localhost:81/hello/ and localhost:81/world/ . The problem is I can't
figure out how to configure nginx for this.

Here is my current setup:

* The project "hello" is in this directory: /home/jabba/public_pyapps/hello/
* Its nginx entry:

server {
    listen      81;
    server_name localhost;
    charset     utf-8;
    client_max_body_size 75M;

    location / { try_files $uri @yourapplication; }
    location @yourapplication {
        include uwsgi_params;
        uwsgi_pass unix:/home/jabba/public_pyapps/hello/hello_uwsgi.sock;
    }
}

It's available at localhost:81 .

Questions:

(1) How to make it available under localhost:81/hello/ instead?

(2) If I add a new application (e.g. "world"), how to add it to nginx?

Thanks,

Laszlo

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

nginx config: different projects in different directories Jabba Laci <jabba.laci@gmail.com> - 2013-10-06 23:25 +0200
  Re: nginx config: different projects in different directories Roy Smith <roy@panix.com> - 2013-10-06 18:31 -0400

csiph-web