是否可以在同一台服务器上运行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 等等?
答案 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
}
}