B
B
blackstone2013-03-29 17:20:34
Nginx
blackstone, 2013-03-29 17:20:34

How to set up nginx to share django and php on the same domain but with different paths?

Hello!
I need the django backend to work on the same url, but with different paths site.com/path1 (I know how), and on the other site.com/path2 the php backend works through php5-fpm. And therefore that all php scripts work only on the site.com/path2 path and nowhere else.
i did this
upstream path2 {
server localhost:9000 fail_timeout=0;
}
and standard for php
location ~ \.php$ {
fastcgi_pass map;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
and php responds to me regarding the root path, but I need only /path2/
If possible, please provide an example of a finished nginx config.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
B
blackstone, 2013-11-21
@blackstone

Thanks for answers.
I still decided to abandon the use of php, and rewrite everything in django.
But I took note of the answer - now I can imagine how to do it.

N
Niko True, 2013-11-21
@buloshnik

@blackstone , you would answer - the issue is resolved or not.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question