Answer the question
In order to leave comments, you need to log in
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
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.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question