问题描述
我有两个进程
- Django和MYSQL
- node / express和mongo db
1。
如何将这两个过程配置为到不同的url
喜欢。 Django指向api.abc.com/v1,节点指向api.abc.com/v2?
2。
我的所有用户登录都在Django和MYSQL与OAuth之间。我可以在Django中验证用户。
但是,如何通过Django REST OAuth发送令牌来验证nodejs应用中的用户?
谢谢。
你可以用很少的方法来做,但最方便的方法是使用像nginx这样的反向代理。 >
为您的Node应用程序配置反向代理,并为您的Django应用程序执行完全相同的操作,您可以轻松地拥有所需的路由,只需在相同的域名和端口号不同的路径。
另一个选择是从Node应用程序向Django应用程序或其他方式代理请求,但这将需要更改应用程序,而不是
以下是关于如何使用nginx,Apache甚至Microsoft IIS为Node配置反向代理的一些问题:
Hi I have two process
- Django and MYSQL
- node/express and mongo db.
1.
How can I configure this two process to point to different urllike. Django point to api.abc.com/v1 and node point to api.abc.com/v2 ?
2.
all my user login is inside Django and MYSQL with OAuth. I can authenticate user in Django.
But how can authenticate user in nodejs app with the token send by Django REST OAuth ?
Thanks.
You can do it in few ways but the most convenient method would be to use a reverse proxy like nginx.
Configuring the reverse proxy for your Node app and doing exactly the same for your Django app will let you easily have the routes that you require, on the same domain name and port number just in a different path.
Another option would be to proxy requests either from the Node app to the Django app or the other way around, but that would require changing your applications instead of just putting a proxy in front of them.
Here are some questions with onfo on how to configure reverse proxies for Node using nginx, Apache and even Microsoft IIS:
- NGINX Reverse Proxy Causes 502 Errors On Some Pages
- reverse proxy using ngix and ssl implementation on express failed
- SSL With node / IIS
- Adding chat through websocket, to an existing PHP web app
- Where do I put my Node JS app so it is accessible via the main website?
- How to run nodejs server over 443 ensuring nginx doesnt stop working
- Configuring HTTPS for Express and Nginx
这篇关于Django和Node进程的同一个域的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!