是否有可能在同一服务器上运行Django和Wordpress与apache的选择性URL?

时间:2014-12-02 23:54:40

标签: django wordpress apache

是否可以在同一台服务器上运行Django和Wordpress?我已经看到了其他的例子,其中可能由django和/ blog / by wordpress处理,但是怎么样

/api/ -- eg. api/v1/user/show
/signin/,
/create/,
/dashboard/ -- eg. dashboard/reports/

由Django和

/
/about/
/security/
/contact/
/tos/
/privacy/
/faq/
/contact/
用Wordpress

等等?

1 个答案:

答案 0 :(得分:2)

是的,据我所知,如果您使用的是nginx和uwsgi,您可以像这样配置nginx:

upstream django {
    server unix:/path/to/your/django/project/your.sock; # for a file socket
}

server {
    location /about{
        proxy_pass http://127.0.0.1:8080;# where your wordpress run
    }
    location /secirity{
        proxy_pass http://127.0.0.1:8080;# where your wordpress run
    }
    # other url needed to handle by wordpress

    # left are all handled by django
    location / {
        uwsgi_pass  django;
        include     /path/to/your/django/project/uwsgi_params; # the uwsgi_params file you installed
    }
}