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


Groups > comp.lang.python > #56282 > unrolled thread

nginx config: different projects in different directories

Started byJabba Laci <jabba.laci@gmail.com>
First post2013-10-06 23:25 +0200
Last post2013-10-06 18:31 -0400
Articles 2 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  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

#56282 — nginx config: different projects in different directories

FromJabba Laci <jabba.laci@gmail.com>
Date2013-10-06 23:25 +0200
Subjectnginx config: different projects in different directories
Message-ID<mailman.796.1381094733.18130.python-list@python.org>
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

[toc] | [next] | [standalone]


#56285

FromRoy Smith <roy@panix.com>
Date2013-10-06 18:31 -0400
Message-ID<roy-0E888C.18314506102013@news.panix.com>
In reply to#56282
In article <mailman.796.1381094733.18130.python-list@python.org>,
 Jabba Laci <jabba.laci@gmail.com> wrote:

> The problem is I can't
> figure out how to configure nginx for this.

This is a python mailing list.  You would do better asking nginx 
questions on an nginx mailing list.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web