简体   繁体   English

jQuery网页和node.js作为服务器

[英]Jquery web page and node.js as server

I am completely new to node.js 我对node.js完全陌生

I am web developer and I already have a jquery mobile webpage. 我是Web开发人员,已经有了一个jQuery移动网页。 My team is moving the server from php (same server as my page) to node.js and I have a problem due to cross domain. 我的团队正在将服务器从php(与页面相同的服务器)移至node.js,由于跨域,我遇到了问题。

How should I tell them to configure node server to work in the same port as apache? 我应该如何告诉他们将节点服务器配置为与apache在同一端口上工作? Now apache is running on 80 and node.js in 8080 but we want to change the second one to be able to work with my page. 现在apache在80和8080上运行在node.js上,但是我们想更改第二个以能够与我的页面一起使用。

If this is not possible, would be possible to return my webpage from node.js server? 如果这不可能,是否可以从node.js服务器返回我的网页? How should we do this? 我们应该怎么做? Webpage just depends on the server to get data. 网页仅取决于服务器获取数据。

You can redirect port 80 to port 8008 using this command: 您可以使用以下命令将端口80重定向到端口8008:

sudo iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080

Hope that helps. 希望能有所帮助。

Got this from this stackoverflow question . 这个stackoverflow问题得到了这个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM