作者:bell723_893 | 来源:互联网 | 2023-01-19 10:51
IhaveaPHPapplicationbeingservedthroughapacheonport80.Ihaveanodejsapplicationrunning
I have a PHP application being served through apache on port 80. I have a nodejs application running standalone on port 3000. I want to make ajax requests from the client side code generated by PHP to the nodejs application. The problem is the same origin policy won't allow a different port, and I can't run both nodejs and apache on port 80.
我有一个PHP应用程序通过端口80上的apache提供服务。我有一个nodejs应用程序在端口3000上独立运行。我想从PHP生成的客户端代码向nodejs应用程序发出ajax请求。问题是相同的源策略不允许不同的端口,我不能在端口80上运行nodejs和apache。
What I would ideally like to do is have them both appear to run on port 80 from the client's perspective. How can I set up apache to reroute/alias/whatever certain requests to the nodejs application?
我理想的做法是让它们看起来都是从客户端的角度在端口80上运行。如何设置apache以重新路由/别名/对nodejs应用程序的任何特定请求?
Hope that makes sense. Note: Not sure if this is possible, or if I am going about it in the right way - open to suggestions.
希望有道理。注意:不确定这是否可行,或者我是否以正确的方式进行 - 请接受建议。
1 个解决方案