0

mysite.com/admin/ [ gives django admin panel fine]
Error : mysite.com/blog/index.php [ downloads index.php instead of serving it ]
kindly suggest some changes in nginx.config file.

upstream django {
    server unix:///home/ubuntu/web/www.mysite.com/uwsgi-tutorial/mysite/mysite.sock; # for a file socket
}
upstream php{
    server 127.0.0.1:9000;
}
server {
    listen      80;
    server_name mysite.com www.mysite.com;
    charset     utf-8;
    location ~ /blog/.+\.php$ {
                fastcgi_pass 127.0.0.1:9000;
                alias /var/www;
                try_files $uri =404;
                fastcgi_index index.php;
                include fastcgi_params;
   }
    location / {
        uwsgi_pass  django;
        include     /home/ubuntu/web/www.mysite.com/uwsgi-tutorial/mysite/uwsgi_params; # the uwsgi_params file you installed
    }
}
Sourabh Singh
  • 46
  • 1
  • 6

1 Answers1

0

Have a look at the following: How to deploy a WordPress site and Django site on the same domain?

This is possibly a duplicate.

Again from above answer, this is probably what you are looking for: http://worldofsam.com/blog/2011/08/hosting-wordpress-on-a-nginx-uwsgi-django-site/

Let me know, if that doesn't solve your problem.

Community
  • 1
  • 1
Saurabh Kumar
  • 5,576
  • 4
  • 21
  • 30