General Question

knight's avatar

Nginx config for django apps?

Asked by knight (35points) September 21st, 2010

Hi,

I have a big django app running with apache.
I would like to try nginx. The problem is that I have many instances on the same machine with different prefixes:
<ip>/peertv
<ip>/peergw
...

And I want them to run on the same port.

Is it possible to do such configuration with nginx and if yes, do you have an example/configs templates/places to read?
(Tried some docs and explanations an it didn’t work out)

Thanks, Alex A.

Observing members: 0 Composing members: 0

7 Answers

andrew's avatar

You want to research virtual hosts.

knight's avatar

Ok. But where and how do I write my different prefixes?

timtrueman's avatar

I think this thread will help you out.

knight's avatar

Thanks for the answer but I don’t have 2 apps running on different ports. I want them to run on one port. Is it possible?

timtrueman's avatar

No. Internally they must run on different ports. To your users, they can be combined onto one using the aforementioned technique.

knight's avatar

Ok. And there is no way to run 2 fastcgi processes, for example and define that one prefix goes to the first one and another prefix goes to second?

timtrueman's avatar

There is. You must run them on different port internally and expose them on the same IP with different paths for that to work. Does that make sense? You cannot run FCGI in two processes on the same port. That doesn’t matter though since you can use the link I posted in the beginning to expose your users to the different paths on the same port.

Answer this question

Login

or

Join

to answer.

This question is in the General Section. Responses must be helpful and on-topic.

Your answer will be saved while you login or join.

Have a question? Ask Fluther!

What do you know more about?
or
Knowledge Networking @ Fluther