# Nginx config: different projects in different directories

**URL:** <https://www.ruby-forum.com/t/nginx-config-different-projects-in-different-directories/246385>\
**Category:** NGINX\
**Created:** [October 7, 2013, 7:28am UTC](https://www.ruby-forum.com/t/nginx-config-different-projects-in-different-directories/246385 "2013-10-07T07:28:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [October 7, 2013, 7:28am UTC](https://www.ruby-forum.com/t/nginx-config-different-projects-in-different-directories/246385/1 "2013-10-07T07:28:36Z")

</div>

Hi,

I’m new to the list. I started to learn the Python web framework 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”) next to previous ones,  
how to add it to nginx?

Thanks,

Laszlo

---

<div class="post-metadata">

**Author:** ![Jabba\_Laci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jabba\_Laci](https://www.ruby-forum.com/u/Jabba_Laci)\
**Post date:** [October 7, 2013, 7:51am UTC](https://www.ruby-forum.com/t/nginx-config-different-projects-in-different-directories/246385/2 "2013-10-07T07:51:59Z")

</div>

> Maybe try setting location /hello and /world would help?

I tried that but it didn’t work.

Laszlo

---

<div class="post-metadata">

**Author:** ![Jabba\_Laci](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e47c2d/32.png) [@Jabba\_Laci](https://www.ruby-forum.com/u/Jabba_Laci)\
**Post date:** [October 7, 2013, 7:40am UTC](https://www.ruby-forum.com/t/nginx-config-different-projects-in-different-directories/246385/3 "2013-10-07T07:40:17Z")

</div>

Maybe try setting location /hello and /world would help?

Thanks,  
Ruben Tan
